Results 1 to 10 of 10

Thread: QSlider step customize

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #7
    Join Date
    Mar 2007
    Posts
    19
    Thanks
    2
    Thanked 1 Time in 1 Post

    Default Re: QSlider step customize

    Take a look at
    Qt Code:
    1. QStyle::sliderValueFromPosition ( int min, int max, int position, int span, bool upsideDown = false )
    To copy to clipboard, switch view to plain text mode 

    So:
    Qt Code:
    1. void CustomSlider::mouseReleaseEvent(QMouseEvent * event) {
    2. setValue(QStyle::sliderValueFromPosition(minVal,maxVal,event->x(),width(),0));
    3. }
    To copy to clipboard, switch view to plain text mode 

  2. The following user says thank you to BatteryCell for this useful post:

    Luc4 (20th June 2010)

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
  •  
Qt is a trademark of The Qt Company.