[Solved] Tooltip display problem?
-
wrote on 28 Sept 2011, 11:01 last edited by
Suppose i have a window containing one button. I have set a tool tip to that button. When i click that button a new window is opened. In this case once the focus pass to new window when i take the mouse pointer to button again the tool tip is not visible(without clicking). How can i make it visible?
-
wrote on 28 Sept 2011, 11:12 last edited by
Do you mean something like this??
!http://img847.imageshack.us/img847/5848/windowu.png!
Does the new windows have the button too?
If so, I miss it... :P -
wrote on 28 Sept 2011, 11:30 last edited by
Not sure how to do with that. It always annoyed me that (under Linux/X11, at least) the behaviour is inconsistent between toolkits. GTK-based applications will display a tooltip even if the window hasn't focus. Qt-based ones won't.
-
wrote on 28 Sept 2011, 12:23 last edited by
ya luisvaldes88 exactly like that, the new window may or may not have button. do you know the solution
-
wrote on 30 Sept 2011, 11:03 last edited by
hi pratik041, as peppe said, Qt app don't display tooltips where they are not focused.
A solution may be, try to make the button@bool QWidget::setMouseTracking(true)@
and then do something in
@void QWidget::mouseMoveEvent ( QMouseEvent * event )@
I did not try, but in theory, whenever you pass your mouse over the button, it will create a move event that will be handled in
@void QWidget::mouseMoveEvent ( QMouseEvent * event )@
If you try it let us know
best regards.
-
wrote on 30 Sept 2011, 11:07 last edited by
Actually the following is working and i think it is the best solution to do this @window.setAttribute (Qt::WA_AlwaysShowToolTips, true);@
-
wrote on 30 Sept 2011, 11:09 last edited by
Hey thanks.
I'll take a note on this. =,)
how did you find it?
-
wrote on 30 Sept 2011, 11:15 last edited by
In Qt namespace documentation see Qt::WidgetAttribute type
1/8