Results 1 to 6 of 6

Thread: QSlider

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Question QSlider

    Hi,
    there is a way to set the step of a slider float? Thanks
    Regards

  2. #2
    Join Date
    Jan 2006
    Posts
    10
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    MacOS X Windows

    Default Re: QSlider

    Your question is a bit vague, but I assume you want the slider to step in discrete increments. In that case, set max value to something less than the physical pixel attributes of your slider. For example, if your slider is 100 pixels wide and you set the max value to 7, the slider is going to use discrete increments.

    So you slider represents a value from 0 to 100. You could set the max value of your slider to 10 and each value would be multiplied by 10 to get your value.

    M

  3. #3
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: QSlider

    I need set step of slider to eg. 0.01; when Igo on to next position of slider its value jum to 0.02; it is connected to a lcd (that should be show 0.01, 0.02 but in this moment I don't know to do this...)....Any hints?
    Regards

  4. #4
    Join Date
    Oct 2009
    Posts
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSlider

    I am also struck at the problem.
    Can any one help me?

  5. #5
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: QSlider

    Quote Originally Posted by mickey View Post
    I need set step of slider to eg. 0.01; when Igo on to next position of slider its value jum to 0.02; it is connected to a lcd (that should be show 0.01, 0.02 but in this moment I don't know to do this...)....Any hints?
    Can't you set an interval of 0 and 100 and divide it before displaying it ?

  6. #6
    Join Date
    Sep 2009
    Posts
    140
    Thanks
    4
    Thanked 17 Times in 17 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QSlider

    You need to do the conversion from integer values to float yourself in order to interpret slider position as floating numbers.

    But since you want to connect SIGNAL and SLOTS direclty in float, a way is to create your own slider widget.

Similar Threads

  1. Problems customizing QSlider
    By Antrax in forum Qt Programming
    Replies: 13
    Last Post: 20th December 2011, 07:00
  2. how to number the ticks of QSlider
    By babu198649 in forum Newbie
    Replies: 4
    Last Post: 11th June 2008, 13:46
  3. QSlider problem
    By sincnarf in forum Qt Programming
    Replies: 1
    Last Post: 10th October 2007, 01:07
  4. QSlider Update Problem
    By December in forum Qt Programming
    Replies: 4
    Last Post: 10th September 2006, 04:02
  5. Video and QSlider
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 1st May 2006, 19:37

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.