Results 1 to 10 of 10

Thread: initial position of a QSlider

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2006
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: initial position of a QSlider

    Franco,

    Sorry I wasn't paying attention to which version you're using. setSliderPosition method is in QT 4.

    This shouldn't work but have you tried setting the "value" after the QSlider has been instantiated? If for some strange reason the QSlider wasn't being initialized properly this could show??

  2. #2
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    59
    Thanked 1 Time in 1 Post

    Default Re: initial position of a QSlider

    Thoosle yes I'm using QT 4.
    I followed your suggestion and now it works, but I don't understand why .
    Is possible to have a smooth movement of the cursor?

    Regards,
    Franco

  3. #3
    Join Date
    Nov 2006
    Posts
    23
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 2 Times in 2 Posts

    Default Re: initial position of a QSlider

    Franco,

    If you're using Qt4 then you need to look at the Qt4 docs, not Qt3. The QSlider constructor you show in your code is incorrect for Qt4. This is probably why it doesn't instantiate properly and why it works setting value after instantiation. QSlider has two constructors in Qt4 as follows:


    QSlider ( QWidget * parent = 0 )

    QSlider ( Qt::Orientation orientation, QWidget * parent = 0 )

    try this link http://doc.trolltech.com/4.3/qslider.html

  4. The following user says thank you to Thoosle for this useful post:

    franco.amato (24th September 2008)

  5. #4
    Join Date
    Nov 2007
    Location
    Italy
    Posts
    694
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    59
    Thanked 1 Time in 1 Post

    Thumbs up Re: initial position of a QSlider

    Quote Originally Posted by Thoosle View Post
    Franco,

    If you're using Qt4 then you need to look at the Qt4 docs, not Qt3. The QSlider constructor you show in your code is incorrect for Qt4. This is probably why it doesn't instantiate properly and why it works setting value after instantiation. QSlider has two constructors in Qt4 as follows:


    QSlider ( QWidget * parent = 0 )

    QSlider ( Qt::Orientation orientation, QWidget * parent = 0 )

    try this link http://doc.trolltech.com/4.3/qslider.html
    Thanks for the link.
    I didn't see the reference to qt 3 .
    Regards,
    Franco

Similar Threads

  1. toolbar initial position
    By baray98 in forum Qt Programming
    Replies: 7
    Last Post: 7th September 2007, 07:39
  2. Initial Dialog Position
    By nleverin in forum Newbie
    Replies: 1
    Last Post: 15th July 2007, 10:19

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.