QStatusTipEvent Class Reference

[ QtGui module]

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

继承 QEvent .

方法


详细描述

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

可以为 Widget 设置状态提示使用 QWidget.setStatusTip () 函数。 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.

也可以为动作设置状态提示使用 QAction.setStatusTip () 函数:

 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 枚举值。


方法文档编制

QStatusTipEvent.__init__ ( self , QString  tip )

构造状态提示事件,采用的文本指定通过 tip .

另请参阅 tip ().

QStatusTipEvent.__init__ ( self , QStatusTipEvent )

QString QStatusTipEvent.tip ( self )

返回要展示在状态栏中的消息。

另请参阅 QStatusBar.showMessage ().