IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

QStatusTipEvent Class

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

Article lu   fois.

L'auteur

Liens sociaux

Viadeo Twitter Facebook Share on Google+   

QStatusTipEvent Class

  • Header: QStatusTipEvent

  • CMake:

    find_package(Qt6 REQUIRED COMPONENTS Gui)

    target_link_libraries(mytarget PRIVATE Qt6::Gui)

  • qmake: QT += gui

  • Inherits: QEvent

  • Group: QStatusTipEvent is part of events, helpsystem

Detailed Description

Status tips can be set on a widget using the QWidget::setStatusTip() function. They are shown in the status bar when the mouse cursor enters the widget. For example:

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

    setCentralWidget(myWidget);
    ...
}
Widget with status tip.

Status tips can also be set on actions using the QAction::setStatusTip() function:

 
Sélectionnez
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 enum value.

See Also

Member Function Documentation

 

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

Constructs a status tip event with the text specified by tip.

See Also

See also tip()

QString QStatusTipEvent::tip() const

Returns the message to show in the status bar.

See Also

Vous avez aimé ce tutoriel ? Alors partagez-le en cliquant sur les boutons suivants : Viadeo Twitter Facebook Share on Google+