forked from qt-creator/qt-creator
Remove usages of deprecated APIs (part 2)
Replace the uses of deprecated APIs listed below, while keeping in mind that compatibility with Qt 5.12 (the latest LTS) must be kept. This means that the new alternatives must be used only when compiling with Qt versions where the replacement is available. Replaced: QLineF::intersect() -> QLine::intersects() (since 5.14) QComboBox::activated() -> QComboBox::textActivated() (since 5.14) QWheelEvent::pos() -> QWheelEvent::position() (since 5.14) QList::swap() -> QList::swapItemsAt() (since 5.13) Task-number: QTBUG-76491 Change-Id: I62adc4f0826607b0156bf4bc5648ffb0e41cd895 Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -209,8 +209,13 @@ void TimelineRenderer::wheelEvent(QWheelEvent *event)
|
||||
|
||||
int degrees = (event->angleDelta().x() + event->angleDelta().y()) / 8;
|
||||
const qint64 circle = 360;
|
||||
#if QT_VERSION < QT_VERSION_CHECK(5, 14, 0)
|
||||
qint64 mouseTime = event->pos().x() * zoom->windowDuration() / width() +
|
||||
zoom->windowStart();
|
||||
#else
|
||||
qint64 mouseTime = event->position().toPoint().x() * zoom->windowDuration() / width() +
|
||||
zoom->windowStart();
|
||||
#endif
|
||||
qint64 beforeMouse = (mouseTime - zoom->rangeStart()) * (circle - degrees) / circle;
|
||||
qint64 afterMouse = (zoom->rangeEnd() - mouseTime) * (circle - degrees) / circle;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user