Results 1 to 2 of 2

Thread: combining wheel events

  1. #1
    Join Date
    Nov 2009
    Location
    San Antonio, TX
    Posts
    69
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt Jambi
    Platforms
    Unix/X11 Windows

    Default combining wheel events

    I have an application that is using the wheelEvent handler to zoom in and out of a data window. If the user scrolls the wheel fairly fast, the function is called multiple times, each with a delta of 120 or -120 (depending on which way the user spins). Is there a way to force these events to be combined so the function receives one large delta? Or is there a way to peek into the event queue to see if there are other wheel events pending?

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: combining wheel events

    You can override the wheelevent and implement your own logic.
    What you can do is use a timer. Start the timer when u get a wheel event and the timer is not running.
    Stack the events / store delta value for the wheel events that are received while the timer is active, and ignore the event.
    Now when the timer gets timed out, emit a signal with the combined delta

    Hope you get the idea

  3. The following user says thank you to aamer4yu for this useful post:

    waynew (23rd January 2010)

Similar Threads

  1. QGLWidget and wheel event
    By shenakan in forum Qt Programming
    Replies: 1
    Last Post: 6th November 2009, 15:21
  2. wheel event problem
    By bhogasena in forum Qt Programming
    Replies: 1
    Last Post: 30th January 2009, 19:11
  3. Qt for iTouch-like 3D wheel music browser?
    By joanna in forum Qt Programming
    Replies: 2
    Last Post: 5th September 2008, 18:51
  4. Wheel and QTest
    By skrzypu in forum Qt Programming
    Replies: 1
    Last Post: 12th May 2008, 20:05
  5. QScrollArea wheel focus
    By bunjee in forum Qt Programming
    Replies: 3
    Last Post: 1st November 2007, 16:59

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.