[Qt-interest] Qt 4.6.1 - no tooltips in menu bar QAction

Constantin Makshin cmakshin at gmail.com
Thu Apr 1 20:06:48 CEST 2010


On Thu, 01 Apr 2010 21:45:13 +0400, Stephen Collyer <scollyer at netspinner.co.uk> wrote:
> On 1 April 2010 18:00, Constantin Makshin <cmakshin at gmail.com> wrote:
>> 1) "Increase font size" is the action's text/title, not a tooltip;
> The Qt docs say:
> QAction::QAction ( const QIcon & icon, const QString & text, QObject * parent )
>
> Constructs an action with an icon and some text and parent. If parent is an action group the action will be automatically inserted into the
> group.
>
> The action uses a stripped version of text (e.g. "&Menu Option..." becomes "Menu Option") as descriptive text for tool buttons. You can override this by setting a specific description with setText(). The same text will be used for tooltips unless you specify a different text using setToolTip().
>
> The final sentence seems to imply that this text is used as the tooltip. Is this an error ?
No, the docs are correct, I forgot about using actions in toolbars. :P

>> 2) menu items can't show tooltips.
> Is this something that you've discovered through experience ?
> I can't see anything in the Qt docs for QMenuBar or QToolTip that indicates this.
Native Windows menus don't support tooltips, Qt menus don't use tooltips, Gtk+ menus don't use tooltips. I thought it's standard menu behavior, isn't it?

Toolbars can be shown in "icons only" mode and in that case tooltips are the only way of showing the button's brief description. What's the purpose of tooltips in menus? Brief description is the item's label itself, detailed description can be displayed in status bar (http://qt.nokia.com/doc/4.6/qaction.html#statusTip-prop).

-- 
Constantin Makshin



More information about the Qt-interest-old mailing list