PDA

View Full Version : Can you change the default priority of QMouseEvents?



itbarr
5th November 2010, 13:33
Hi folks,

Sorry if this is a dumb question but I'm rather new to this all...

Is it possible to set the priority for QMouseEvents so that when the main loop dispatches they will always be handled ahead of other event types?

I see there is the following function:

void QCoreApplication::postEvent ( QObject * receiver, QEvent * event, int priority )

Where the priority of an event can be specified.

How does Qt post QMouseEvents it gets from the X.11 stack?

Regards,
Ivan

high_flyer
5th November 2010, 14:04
Why is the priority important for you?
It sounds you are trying to solve a problem from the wrong end.
Maybe if you tell us what it is you are trying to achieve, and why - we might be able to help you solve it with out such "acrobatics".

To change the priority used by QCoreApplication for the system events you will have to change QCoreApplication.

itbarr
5th November 2010, 14:08
It's for a Web browser application running in an embedded environment with very limited CPU. I want mouse events to take precedence over other events so that we can react quickly to user input rather than waiting until all the other events on the queue are cleared first... (which can take a while if the Browser is busy handling a complex page load)

high_flyer
5th November 2010, 14:48
Maybe it is possible to set the mouse events priority in the underlying windowing system.
If not, you will have to go low level.
Specifically have a look at the doc of QAbstractEventDispatcher.

Good luck!