Commit 91b26ccc authored by Wolfgang Bauer's avatar Wolfgang Bauer

Fix build with Qt versions before 5.12

The used QWheelEvent constructor only exists since Qt 5.12, so use an obsolete one
instead when building with lower versions.

This is basically a conditional revert of (parts of) commit 35f3a486.
parent 822e8cd2
......@@ -211,8 +211,13 @@ void ThumbnailView::ThumbnailWidget::wheelEvent(QWheelEvent *event)
cellGeometryInfo()->calculateCellSize();
model()->endResetModel();
} else {
#if QT_VERSION < QT_VERSION_CHECK(5, 12, 0)
const int delta = event->delta() / 5;
QWheelEvent newevent = QWheelEvent(event->pos(), delta, event->buttons(), event->modifiers());
#else
const auto angleDelta = event->angleDelta() / 5;
QWheelEvent newevent = QWheelEvent(event->pos(), event->globalPos(), event->pixelDelta(), angleDelta, event->buttons(), event->modifiers(), event->phase(), event->inverted());
#endif
QListView::wheelEvent(&newevent);
event->setAccepted(newevent.isAccepted());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment