Results 1 to 2 of 2

Thread: QScrollBar setValue() vs setSliderPosition()

  1. #1
    Join Date
    May 2019
    Posts
    11
    Thanks
    3
    Thanked 1 Time in 1 Post
    Qt products
    Qt5
    Platforms
    Unix/X11

    Question QScrollBar setValue() vs setSliderPosition()

    I am using a QScrollArea. I would like to change the position of it by setting the vertical scrollbar's position. There are two possible methods setValue() and setSliderPosition(). The documentation states that the difference between them is that there is tracking on one of them. What is meant by tracking?
    I look forward to hearing from you.

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QScrollBar setValue() vs setSliderPosition()

    From QAbstractSlider:
    If tracking is enabled (the default), the slider emits the valueChanged() signal while the slider is being dragged. If tracking is disabled, the slider emits the valueChanged() signal only when the user releases the slider.
    and here:
    This signal is emitted even when tracking is turned off.
    I assume setValue() will honour the tracking behaviour, and setSliderPosition() will always announce changes through sliderMoved() even when tracking is off.

Similar Threads

  1. Override setValue() of QScrollBar
    By RolandHughes in forum Qt Programming
    Replies: 1
    Last Post: 11th October 2014, 20:07
  2. Replies: 10
    Last Post: 10th February 2013, 15:30
  3. How to use setValue in QSqlTableModel?
    By jtdavidson in forum Newbie
    Replies: 1
    Last Post: 21st July 2010, 16:10
  4. SetValue
    By phillip_Qt in forum Qt Programming
    Replies: 4
    Last Post: 3rd October 2007, 23:45
  5. QProgressDialog::setValue crash( Mac )
    By marcel in forum Qt Programming
    Replies: 7
    Last Post: 12th April 2007, 00:12

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.