In questa pagina

QStatusTipEvent Class

La classe QStatusTipEvent fornisce un evento utilizzato per visualizzare messaggi nella barra di stato. Per saperne di più...

Intestazione: #include <QStatusTipEvent>
CMake: find_package(Qt6 REQUIRED COMPONENTS Gui)
target_link_libraries(mytarget PRIVATE Qt6::Gui)
qmake: QT += gui
Eredita da: QEvent

Funzioni pubbliche

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

Funzioni protette

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

Descrizione dettagliata

È possibile impostare suggerimenti di stato su un widget utilizzando la funzione QWidget::setStatusTip(). Questi vengono visualizzati nella barra di stato quando il cursore del mouse entra nel widget. Ad esempio:

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

    setCentralWidget(myWidget);
    ...
}

Widget con suggerimento di stato.

È inoltre possibile impostare i suggerimenti di stato sulle azioni utilizzando la funzione 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);
    ...
}

Azione con suggerimento sullo stato.

Infine, i suggerimenti di stato sono supportati per le classi di visualizzazione degli elementi tramite il valore dell’enumerazione ` Qt::StatusTipRole `.

Vedi anche QStatusBar, QHelpEvent e QWhatsThisClickedEvent.

Documentazione sulle funzioni membro

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

Crea un evento "status tip" con il testo specificato da tip.

Vedi anche tip().

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

Crea un'istanza di ` QStatusTipEvent` tramite `move`. Questa funzione è stata eliminata.

QString QStatusTipEvent::tip() const

Restituisce il messaggio da visualizzare nella barra di stato.

Vedi anche QStatusBar::showMessage().

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

Assegna " other " a questa istanza di " QStatusTipEvent ". Questa funzione viene eliminata.

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

Assegna “ other ” a questa istanza di “ 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.