QStatusTipEvent Class

QStatusTipEventクラスは、ステータスバーにメッセージを表示するためのイベントを提供します。詳細...

ヘッダー #include <QStatusTipEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
継承: QEvent

パブリック関数

QStatusTipEvent(const QString &tip)
QString tip() const

詳しい説明

ステータスチップは、QWidget::setStatusTip() 関数を使用してウィジェットに設定できます。マウスカーソルがウィジェットに入ると、ステータスバーに表示されます。例えば

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.

最後に、ステータス・ヒントは、Qt::StatusTipRole enum値を通してアイテム・ビュー・クラスでサポートされます。

QStatusBarQHelpEventQWhatsThisClickedEventも参照してください

メンバ関数ドキュメント

[explicit] QStatusTipEvent::QStatusTipEvent(const QString &tip)

tip で指定されたテキストでステータスチップイベントを構築する。

tip()も参照

QString QStatusTipEvent::tip() const

ステータス・バーに表示するメッセージを返します。

QStatusBar::showMessage()も参照

© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.