Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
5.9.6, 5.12.0 Beta 2
-
None
-
Windows
Description
The QBasicDrag::eventFilter method is intentionally eating scroll events, resulting in intermittent scroll results in QWidgets on Windows. Because the QEvent::Wheel events are being eaten during drag and drop, only scroll events which occur on the same frame that DND calls processEvents() are issued to the rest of the application. This results in repeated scrolling to register a single scroll, and entirely undesirable behaviour.
I would advise a small code change to qtbase\src\gui\kernel\qsimpledrag.cpp : 195
case QEvent::MouseButtonDblClick: return true; case QEvent::Wheel: const QMouseEvent *scroll = static_cast<QMouseEvent *>(e); const QWindow *scrollWindow = topLevelAt(scroll->globalPos()); if (!scrollWindow) scrollWindow = m_current_window; QPoint scrollWindowPos = (scrollWindow ? scrollWindow->mapFromGlobal(scroll->globalPos()) : scroll->globalPos()); QMouseEvent *newScroll = new QMouseEvent(scroll->type(), scrollWindowPos, scrollWindowPos, scroll->screenPos(), scroll->button(), scroll->buttons(), scroll->modifiers(), scroll->source()); QCoreApplication::postEvent(o, newScroll); return true; // defer mouse scroll events until drag event loop has returned
This code is based off the case for QEvent::MouseButtonRelease and should result in scroll events being passed to the application properly.
This is highly desirable as drag operations typically occur on a list, and it is a non-intrusive and natural methodology to utilize the scroll wheel to scroll the list view or other destination widget.
QTBUG-45838 reports this behaviour as an issue; this solution should resolve that.
I've marked affected versions as 5.9.6 (the version we're running internally) and 5.12 after verifying this code has not changed in the latest distributions of source for 5.12.
Attachments
Issue Links
- relates to
-
QTBUG-45838 Simultaneous scrolling and dragging fails sometimes in ListView
-
- Open
-
Gerrit Reviews
For Gerrit Dashboard: QTBUG-71288 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
385298,1 | xcb: Allow to scroll by wheel while dragging | dev | qt/qtbase | Status: NEW | 0 | 0 |