[Development] MouseMoveEvent sluggishness on Qt5 vs Qt4

Morten Johan Sørvig morten.sorvig at digia.com
Fri Dec 5 14:47:10 CET 2014


> On 04 Dec 2014, at 12:20, Renaud <renaud.guezennec at gmail.com> wrote:
> 
> I have noticed that the mouseMoveEvents are no more compressed. So in Qt4, if you perform long (update) task in response to mouseMoveEvent. The Qt event loop stopped sending events until your job is finished. All events you received in the meantime were dropped. Then, you may received another mouseMoveEvent.
> So, the lazy mode was made by the mouseMoveEvent behaviour.
> 
> In Qt5, the mouseMoveEvents are stored in the queue. So when you receive an event and perform its task in response, the queue grows up. You will do an updateGL for every event you received. Put "update" instead updateGL hides the issue. I mean, the event compression is made at the level of update and no longer on mouseMoveEvent.
> 
> Where you received may be 2 or 4 mouseMoveEvent in Qt4. You will receive 20 events in Qt5.
> 
> In my point of view, it is a bug in Qt5 and i'm not alone : https://bugreports.qt-project.org/browse/QTBUG-40889?page=com.googlecode.jira-suite-utilities:transitions-summary-tabpanel

We have two functions available to platform developers that may help:

QWindowSystemInterface:: flushWindowSystemEvents() - Processes all queued WS events. This function is used by several platform plugins today to make sure certain events are delivered immediately.

QWindowSystemInterface:: setSynchronousWindowsSystemEvents() - Disables the WS event queue and makes all QWindowSystemInterface::handle* functions block until the event has been delivered. This mode is not in use today on any shipping platform and is not well tested or supported. An (unsuccessful) attempt was made at enabling it on OS X some time a ago.

I’ve been running into similar issues with Qt-as-a-plugin configurations, were we would like to return the event accepted state to the containing system after delivering the event to Qt.

Do we need a WS event queue? An interesting question, with perhaps a platform-spesific answer.

Morten


More information about the Development mailing list