]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Port away from copying QEvent when building with Qt6
authorAhmad Samir <a.samirh78@gmail.com>
Thu, 5 May 2022 20:12:42 +0000 (22:12 +0200)
committerAhmad Samir <a.samirh78@gmail.com>
Tue, 31 May 2022 14:25:13 +0000 (14:25 +0000)
Copying QEvent in Qt6 isn't allowed, instead use clone().

src/kitemviews/private/kitemlistsmoothscroller.cpp

index f77d3df58d73e2a327ed17a93c4b1e48f051a797..343399179b39d70d73489a1c31d83dc95bbc12a2 100644 (file)
@@ -186,9 +186,15 @@ void KItemListSmoothScroller::handleWheelEvent(QWheelEvent* event)
 
     m_smoothScrolling = true;
 
+#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
+    QWheelEvent *copy = event->clone();
+    QApplication::sendEvent(m_scrollBar, copy);
+    event->setAccepted(copy->isAccepted());
+#else
     QWheelEvent copy = *event;
     QApplication::sendEvent(m_scrollBar, &copy);
     event->setAccepted(copy.isAccepted());
+#endif
 
     m_smoothScrolling = previous;
 }