How to make a QTool tip show when a button is pressed / clicked
-
@ManiRon said in How to make a QTool tip show when a button is pressed / clicked:
the tool tip is not showing till what ever time i have specified ?
What do you mean? You want to have a delay before showing the tool tip? If so then why not using QTimer?
-
-
Hi
Works on linux and windows for me. (Qt 5.9)
it stays the time you tell it.
Do note however, you CANNOT click on the screen in the meantime. then it goes away at once. -
Check your parameters... you have no Text-parameter there...
QToolTip::showText( this->mapToGlobal( QPoint( 0, 0 ) ), "MY_TOOLTIP", qTable, rect,3000);
What is qTable in your case?
-
Hi
Works on linux and windows for me. (Qt 5.9)
it stays the time you tell it.
Do note however, you CANNOT click on the screen in the meantime. then it goes away at once. -
Hi
Works on linux and windows for me. (Qt 5.9)
it stays the time you tell it.
Do note however, you CANNOT click on the screen in the meantime. then it goes away at once.@mrjj it display the tool tip only for few milli seconds , is there something wrong i am doing ?
QRect rect; rect.setHeight(ui->pushbtn->height()); rect.setWidth(ui->pushbtn->width()); QToolTip::showText( this->mapToGlobal( QPoint( 0, 0 ) ), qTable,ui->pushbtn,rect,5000);
-
@ManiRon said in How to make a QTool tip show when a button is pressed / clicked:
the tool tip is not showing till what ever time i have specified ?
What do you mean? You want to have a delay before showing the tool tip? If so then why not using QTimer?
-
Maybe related to https://bugreports.qt.io/browse/QTBUG-18520
-
Maybe related to https://bugreports.qt.io/browse/QTBUG-18520
QRect rect; rect.setHeight(ui->pushbtn->height()); rect.setWidth(ui->pushbtn->width()); this->setToolTipDuration(5000); QToolTip::showText( this->mapToGlobal( QPoint( 0, 0 ) ), qTable,this,rect,5000);
tried something like this but no change
-
Hi
What Qt version are you using?
It works for me with Qt5.9/5.13 on Windows and Linux.