Results 1 to 2 of 2

Thread: get slider value

  1. #1
    Join Date
    Nov 2007
    Posts
    57
    Thanks
    36
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default get slider value

    Hi!
    I have a slider that slides within the range of 0 and 255. I know how to display the slider value but how do you "extraxt" the slider value for other computational porposes? I know there is a function (slider->value() const) but how do you use it to return the value? Do you need to declare a new custom class for that?
    What i need to do is this: every time I change the slider position, I want to assign tthe current slider value to integer A.
    Thanks.Eric

  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: get slider value

    Why don't you connect the slider's valueChanged signal to a slot and assign the value passed to you there to A?

Similar Threads

  1. line edit value change with slider
    By jjbabu in forum Qt Tools
    Replies: 1
    Last Post: 22nd September 2007, 07:02
  2. Replies: 1
    Last Post: 27th August 2007, 13:13
  3. Tick Labels for Slider
    By jcraig in forum Qt Tools
    Replies: 2
    Last Post: 9th August 2007, 17:21
  4. connection between doublesinbox and slider
    By Ucef in forum Qt Programming
    Replies: 1
    Last Post: 24th March 2007, 17:02
  5. Custom (pixmap) slider handle for QScrollBar
    By Antrax in forum Qt Programming
    Replies: 1
    Last Post: 17th October 2006, 11:04

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.