Results 1 to 4 of 4

Thread: Can you change the default priority of QMouseEvents?

  1. #1
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Can you change the default priority of QMouseEvents?

    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:ostEvent ( 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

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Can you change the default priority of QMouseEvents?

    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.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Can you change the default priority of QMouseEvents?

    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)

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Can you change the default priority of QMouseEvents?

    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!
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. How to change default windows class name?
    By Kevin Hoang in forum Qt Programming
    Replies: 5
    Last Post: 11th January 2012, 22:37
  2. How to change default clipping?
    By swbluto in forum Qt Programming
    Replies: 2
    Last Post: 29th October 2009, 18:35
  3. How to change default manifest file?
    By piotr.dobrogost in forum General Programming
    Replies: 1
    Last Post: 22nd July 2009, 08:53
  4. Handling QMouseEvents
    By Lodorot in forum Qt Programming
    Replies: 1
    Last Post: 24th June 2009, 14:21
  5. change txt file type default icon
    By mismael85 in forum Qt Programming
    Replies: 8
    Last Post: 20th February 2008, 22:22

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.