drhex
6th February 2006, 20:53
Hi,
In the short QT-4.1.0 example below, I'm putting a QAction inside a QMenuBar.
It gets shown all right, but if I pause the mouse pointer above the QAction, its
Tooltip is not shown. I have no problems with tooltips on classes that inherit from
QWidget, but what is needed for a QAction's tooltip to be displayed?
/Joakim Rosqvist
#include <QApplication>
#include <QMenuBar>
#include <QAction>
int main( int argc, char **argv )
{
QApplication app( argc, argv );
QMenuBar *bar = new QMenuBar();
QAction *action = bar->addAction("my action");
action->setToolTip("my tooltip");
bar->show();
return app.exec();
}
In the short QT-4.1.0 example below, I'm putting a QAction inside a QMenuBar.
It gets shown all right, but if I pause the mouse pointer above the QAction, its
Tooltip is not shown. I have no problems with tooltips on classes that inherit from
QWidget, but what is needed for a QAction's tooltip to be displayed?
/Joakim Rosqvist
#include <QApplication>
#include <QMenuBar>
#include <QAction>
int main( int argc, char **argv )
{
QApplication app( argc, argv );
QMenuBar *bar = new QMenuBar();
QAction *action = bar->addAction("my action");
action->setToolTip("my tooltip");
bar->show();
return app.exec();
}