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); ... } |
|
也可以为动作设置状态提示使用 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); ... } |
|
Finally, status tips are supported for the item view classes through the Qt.StatusTipRole 枚举值。
构造状态提示事件,采用的文本指定通过 tip .
另请参阅 tip ().
返回要展示在状态栏中的消息。
另请参阅 QStatusBar.showMessage ().