Results 1 to 10 of 10

Thread: tooltip of slider........

  1. #1
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Unhappy tooltip of slider........

    Hi all

    Working on Qtcreator for RHEL

    Can any body tells me that , How can i get the tool tip for slider.
    I have done this.

    myslider->setTooltip(QString::number(myslider->sliderposition()),10);

    but tooltip is not get into picture while running

    Thanx.........

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: tooltip of slider........

    Where did you put this code?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: tooltip of slider........

    in my form constructor.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: tooltip of slider........

    So assuming your slider is initially positioned at 0, you get:

    Qt Code:
    1. myslider->setTooltip("0");
    To copy to clipboard, switch view to plain text mode 
    Isn't that what you get? Doesn't the slider show "0" as its tooltip?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: tooltip of slider........

    No.Nothing is visible .no t even a 0 value;

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: tooltip of slider........

    So this doesn't work?

    Qt Code:
    1. #include <QtGui>
    2.  
    3. int main(int argc, char **argv) {
    4. QApplication app(argc, argv);
    5. QSlider slider;
    6. slider.setToolTip("tooltip");
    7. slider.show();
    8. return app.exec();
    9. }
    To copy to clipboard, switch view to plain text mode 
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Aug 2012
    Posts
    33
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: tooltip of slider........

    No.Its not working.

    in my application i have a slider control.

    and i wrote some thing like this in my form constructor.

    ui->myslider->setposition(10);
    ui->myslider0>settooltip("some text");


    but its not working.i have tried all possible ways.still not able to fox this problem.

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: tooltip of slider........

    Quote Originally Posted by vani.pv View Post
    No.Its not working.

    in my application i have a slider control.
    I'm not asking about your application. Please run the code I gave you and say whether moving the mouse pointer over the slider makes the tooltip appear or not.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  9. #9
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: tooltip of slider........

    hi vani,

    myslider->setTooltip(QString::number(myslider->sliderposition()),10);
    There is a mistake in passing the arguments. setToolTip has only one argument.

    The correct code will be,
    Qt Code:
    1. myslider->setTooltip(QString::number(myslider->sliderposition()));
    To copy to clipboard, switch view to plain text mode 

    Also there is no need to pass 10 for number function.The default argument is 10

    Hope it helps,
    Bala

  10. #10
    Join Date
    Oct 2010
    Location
    Bangalore
    Posts
    52
    Thanks
    8
    Thanked 9 Times in 9 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: tooltip of slider........

    Add these lines of code it will work .....
    connect(ui->horizontalSlider,SIGNAL(sliderMoved(int)),this,SL OT(sliderMoved(int)));

    void MainWindow::sliderMoved(int position)
    {
    ui->horizontalSlider->setToolTip(QString::number(position));
    }

Similar Threads

  1. help on my slider
    By newb in forum Qt Programming
    Replies: 1
    Last Post: 13th July 2010, 15:36
  2. Replies: 2
    Last Post: 21st March 2010, 09:01
  3. Tooltip in Qwt
    By Ankitha Varsha in forum Qwt
    Replies: 5
    Last Post: 8th December 2009, 12:07
  4. get slider value
    By eric in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2007, 19:47
  5. ToolTip....
    By merry in forum Qt Programming
    Replies: 27
    Last Post: 3rd August 2007, 10:42

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.