Hi,
I see when mouse is on an icon action appear a toolTip (square yellow) and the same text of toolTips appear in the bottom of windows application. Is it possible write a Qstring in the bottom of window? Thanks
Hi,
I see when mouse is on an icon action appear a toolTip (square yellow) and the same text of toolTips appear in the bottom of windows application. Is it possible write a Qstring in the bottom of window? Thanks
Regards
I am not exactly sure what you mean. QActions have toolTips and statusTips. By default, if an action has a tooltip, and if no status tip is defined, the action uses the tool tip text to be displayed in the status bar. You can set a different statusTip text using setStatusTip if you want the text displayed in the statusbar to be different than the action's tooltip text.
If you just want to display some text in the statusbar, well, there are various ways of accomplishing this; but the simlpest is to use one of the QStatusBar::message(...) methods.
Bojan
The march of progress:
C:
printf("%10.2f", x);
C++:
cout << setw(10) << setprecision(2) << showpoint << x;
Java:
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);
Just remember that the status bar is available by default only in QMainWindow.
ok. But this change temporary status bar (text on the left). I'd like to take fix a text in the center of status bar when statusbar change text for move mouse on QActions.
is it Possible? I'm looking for a carefully place for a Qstring of max 11 char without using textLabel....
Regards
This should help you:
void QStatusBar::message ( const QString & message ) [slot]
Hides the normal status indicators and displays message until clear() or another message() is called.
See also clear().
Example: regexptester/regexptester.cpp.
I don't like hide normal status. I'd like have a normal status text and a blocked text in the center of status bar (not on the left)....
Regards
Then insert a label into the status bar and display there.
I prove to insert a label in status bar from designer but it seems impossible..
Regards
Not everything can be done from Designer. You have to do that in init() or in subclass constructor.
Hi, I insert this in ini costructor:
It works but the problem is wheen mouse is over action my label is replaced with tooltips....When I move out action my label appears...Qt Code:
statusBar()->addWidget (statusLabel,110,FALSE);To copy to clipboard, switch view to plain text mode
Regards
Lets see...
void QStatusBar::addWidget ( QWidget * widget, int stretch = 0, bool permanent = FALSE ) [virtual]
Adds widget to this status bar. widget is reparented if it isn't already a child of the QStatusBar.
widget is permanently visible if permanent is TRUE and may be obscured by temporary messages if permanent is FALSE. The default is FALSE.
If permanent is TRUE, widget is located at the far right of the status bar. If permanent is FALSE (the default), widget is located just to the left of the first permanent widget.
stretch is used to compute a suitable size for widget as the status bar grows and shrinks. The default of 0 uses a minimum of space.
This function may cause some flicker.
See also removeWidget().
The march of progress:
C:
printf("%10.2f", x);
C++:
cout << setw(10) << setprecision(2) << showpoint << x;
Java:
java.text.NumberFormat formatter = java.text.NumberFormat.getNumberInstance();
formatter.setMinimumFractionDigits(2);
formatter.setMaximumFractionDigits(2);
String s = formatter.format(x);
for (int i = s.length(); i < 10; i++) System.out.print(' ');
System.out.print(s);
It's works. But every change below dosn't take place (setweight,bold...).Why?
Qt Code:
f2.setBold(TRUE); f2.setWeight(16); statusLabel->setFont(f2);To copy to clipboard, switch view to plain text mode
Regards
Bookmarks