Home · All Classes · Modules

QStatusTipEvent Class Reference
[QtGui module]

The QStatusTipEvent class provides an event that is used to show messages in a status bar. More...

Inherits QEvent.

Methods


Detailed Description

The QStatusTipEvent class provides an event that is used to show messages in a status bar.

Status tips can be set on a widget using the QWidget.setStatusTip() function. They are shown in the status bar when the mouse cursor enters the widget. For example:

 MainWindow.MainWindow(QWidget *parent)
     : QMainWindow(parent)
 {
     QWidget *myWidget = new QWidget;
     myWidget->setStatusTip(tr("This is my widget."));

     setCentralWidget(myWidget);
     ...
 }

Widget with status tip.

Status tips can also be set on actions using the QAction.setStatusTip() function:

 MainWindow.MainWindow(QWidget *parent)
     : QMainWindow(parent)
 {
     QMenu *fileMenu = menuBar()->addMenu(tr("File"));

     QAction *newAct = new QAction(tr("&New"), this);
     newAct->setStatusTip(tr("Create a new file."));
     fileMenu->addAction(newAct);
     ...
 }

Action with status tip.

Finally, status tips are supported for the item view classes through the Qt.StatusTipRole enum value.


Method Documentation

QStatusTipEvent.__init__ (self, QString tip)

Constructs a status tip event with the text specified by tip.

See also tip().

QStatusTipEvent.__init__ (self, QStatusTipEvent)

QString QStatusTipEvent.tip (self)

Returns the message to show in the status bar.

See also QStatusBar.showMessage().


PyQt 4.12.1 for X11Copyright © Riverbank Computing Ltd and The Qt Company 2015Qt 4.8.7