Qt:Документация 4.3.2/qstatustipevent

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск
40px Внимание: Актуальная версия перевода документации находится здесь

__NOTOC__

Image:qt-logo.png

Главная · Все классы · Основные классы · Классы по группам · Модули · Функции

Image:trolltech-logo.png

Содержание

QStatusTipEvent Class Reference
[модуль QtGui ]

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

 #include <QStatusTipEvent>

Inherits QEvent.

Открытые функции

  • 6 public functions inherited from QEvent

Дополнительные унаследованные члены


Подробное описание

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

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. Пример:


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

Файл:Qstatustipevent-widget.png

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


 MainWindow::MainWindow(QWidget *parent)
     : QMainWindow(parent)
 {
     QMenu *fileMenu = menuBar()->addMenu(tr("File"));
 
     QAction *newAct = new QAction(tr("&amp;New"), this);
     newAct->setStatusTip(tr("Create a new file."));
     fileMenu->addAction(newAct);
     ...
 }

Файл:Qstatustipevent-action.png

Finally, status tips are supported for the item view classes through the Qt::StatusTipRole enum value.

See also QStatusBar, QHelpEvent, and QWhatsThisClickedEvent.


Описание функций-членов

QStatusTipEvent::QStatusTipEvent ( const QString & tip )

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

See also tip().

QString QStatusTipEvent::tip () const

Returns the message to show in the status bar.

See also QStatusBar::showMessage().



Copyright © 2007 Trolltech Trademarks
Qt 4.3.2