Results 1 to 2 of 2

Thread: Scrollbar -- how to differentiate arrows from slider itself

  1. #1
    Join Date
    Apr 2007
    Location
    Toruń, POLAND
    Posts
    24
    Thanks
    7
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Scrollbar -- how to differentiate arrows from slider itself

    Hello,

    I would like to know if the scrollbar position was changed by dragging slider or by pressing arrows (little widgets at the end of slider).

    Background: I am using QTableWidget and I would like to two ways of scrolling, via dragging slider -> fine, precise scrolling line (pixel) by line, or via clicking on arrows to provide faster scrolling, by row.

    have a nice day, bye
    Last edited by macias; 27th August 2007 at 13:07.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Scrollbar -- how to differentiate arrows from slider itself

    It is not possible to do that directly.
    You could connect to the sliderPressed signal and set a flag in your class. Then, when you get the valueChanged signal you will now it was the result of a slider move. Otherwise the buttons were pressed.

    You should take care with user keyboard actions, since they could emit the same signals( without sliderPressed).

    Regards

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

    macias (27th August 2007)

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.