Qt Reference Documentation

QStatusTipEvent Class Reference

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

 #include <QStatusTipEvent>

Inherits QEvent.

Public Functions

QStatusTipEvent ( const QString & tip )
QString tip () const
  • 6 public functions inherited from QEvent

Additional Inherited Members

  • 1 property inherited from QEvent
  • 1 static public member inherited from QEvent

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.

See also QStatusBar, QHelpEvent, and QWhatsThisClickedEvent.

Member Function Documentation

QStatusTipEvent::QStatusTipEvent ( const QString & tip )

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

See also tip().

QString QStatusTipEvent::tip () const

Returns the message to show in the status bar.

See also QStatusBar::showMessage().

X

Thank you for giving your feedback.

Make sure it is related to this specific page. For more general bugs and requests, please use the Qt Bug Tracker.

[0]; s.parentNode.insertBefore(ga, s); })();