Results 1 to 3 of 3

Thread: QDial disabling key scroll and mouse wheel scroll

  1. #1
    Join Date
    Jun 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QDial disabling key scroll and mouse wheel scroll

    I have GUI that interfaces with a piece of hardware. I'm using QDials to send commands to the hardware. The problem is that the hardware can't react fast enough to the constant valueChanged signals being sent from the dial. So what I want to do is just update the hardware when the sliderReleased signal is sent. But the dials values can be changed by using the mouse scroll wheel or the left and right keyboard arrows without sending a sliderReleased signal. So my question: How can I make my dials ignore the key arrows and mouse scroll wheel so that the only way to change the dial is click it and drag it? Thanks in advance!

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: QDial disabling key scroll and mouse wheel scroll

    See the tracking property of the QDial class. If you still need to ignore keyboard events, extend the QDial class and re-implement the keyEvent handler, or install an event filter that ignores them.

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

    ldg20 (3rd June 2010)

  4. #3
    Join Date
    Jun 2010
    Posts
    7
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QDial disabling key scroll and mouse wheel scroll

    Hey, thanks a lot for the reply. Setting the tracking property to false won't work because I'm using the valueChanged signal to update a display that shows the current value of the dial. But re-implementing the necessary events looks like it will work!

Similar Threads

  1. Replies: 0
    Last Post: 28th December 2009, 13:24
  2. Replies: 2
    Last Post: 13th January 2009, 05:32
  3. how to add scroll bar on QGridLayout in QT??
    By sharvari in forum Newbie
    Replies: 3
    Last Post: 19th February 2008, 15:31
  4. QScrollArea mouse events is taken by scroll bars
    By babu198649 in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 10:41
  5. Replies: 6
    Last Post: 14th April 2006, 06:39

Tags for this Thread

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.