Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compilation with Qt < 5.14 #143

Merged
merged 1 commit into from
Apr 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix compilation with Qt < 5.14; QWheelEvent::position was added in 5.…
…14 ("This function was introduced in Qt 5.14.", https://doc.qt.io/qt-5/qwheelevent.html#position)

\QuickQanava\master\src\qanNavigable.cpp(443,23): error C2039: 'position': is not a member of 'QWheelEvent'
\Qt\5.13.0\msvc2015_64\include\QtGui/qevent.h(173): message : see declaration of 'QWheelEvent'
Done building project "QuickQanava.vcxproj" -- FAILED.
  • Loading branch information
StefanVK committed Dec 15, 2021
commit 60132df2ca1926155890fa4a2834ded980c96d31
4 changes: 4 additions & 0 deletions src/qanNavigable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,11 @@ void Navigable::wheelEvent(QWheelEvent* event)
{
if (getNavigable()) {
qreal zoomFactor = (event->angleDelta().y() > 0. ? _zoomIncrement : -_zoomIncrement);
#if (QT_VERSION >= QT_VERSION_CHECK(5,14,0))
zoomOn(event->position(), getZoom() + zoomFactor);
#else // QWheelEvent::position was added in Qt 5.14; pos was deprecated in 5.15.
zoomOn(event->pos(), getZoom() + zoomFactor);
#endif
}
updateGrid();
// Note 20160117: NavigableArea is opaque for wheel events, do not call QQuickItem::wheelEvent(event);
Expand Down