Nesta página

QStatusTipEvent Class

A classe QStatusTipEvent fornece um evento utilizado para exibir mensagens na barra de status. Saiba mais...

Cabeçalho: #include <QStatusTipEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Herdado de: QEvent

Funções públicas

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

Funções protegidas

QStatusTipEvent(QStatusTipEvent &&)
QStatusTipEvent &operator=(QStatusTipEvent &&)
QStatusTipEvent &operator=(const QStatusTipEvent &other)

Descrição detalhada

Dicas de status podem ser definidas em um widget usando a função QWidget::setStatusTip(). Elas são exibidas na barra de status quando o cursor do mouse entra no widget. Por exemplo:

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

    setCentralWidget(myWidget);
    ...
}

Widget com dica de status.

Também é possível definir dicas de status em ações usando a função ` 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);
    ...
}

Ação com dica de status.

Por fim, as dicas de status são suportadas para as classes de visualização de itens por meio do valor de enumeração ` Qt::StatusTipRole `.

Veja também QStatusBar, QHelpEvent e QWhatsThisClickedEvent.

Documentação das funções de membro

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

Cria um evento de dica de status com o texto especificado por tip.

Veja também tip().

[protected delete] QStatusTipEvent::QStatusTipEvent(QStatusTipEvent &&)

Cria uma instância de ` QStatusTipEvent` por meio da função `move`. Essa função foi excluída.

QString QStatusTipEvent::tip() const

Retorna a mensagem a ser exibida na barra de status.

Veja também QStatusBar::showMessage().

[protected delete] QStatusTipEvent &QStatusTipEvent::operator=(QStatusTipEvent &&)

Atribui “ other ” a esta instância de “ QStatusTipEvent ”. Esta função é excluída.

[noexcept protected default] QStatusTipEvent &QStatusTipEvent::operator=(const QStatusTipEvent &other)

Copia e atribui ` other ` a esta instância de ` QStatusTipEvent `.

© 2026 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.