Port away from copying QEvent when building with Qt6

Copying QEvent in Qt6 isn't allowed, instead use clone().
This commit is contained in:
Ahmad Samir 2022-05-05 22:12:42 +02:00
parent 5d3774aa17
commit 49560f921d

View 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;
}