CopperSpice API  1.9.1
QStatusTipEvent Class Reference

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

Inheritance diagram for QStatusTipEvent:
QEvent

Public Methods

 QStatusTipEvent (const QString &tip)
 
QString tip () const
 
- Public Methods inherited from QEvent
 QEvent (const QEvent &other)
 
 QEvent (Type type)
 
virtual ~QEvent ()
 
void accept ()
 
void ignore ()
 
bool isAccepted () const
 
QEvent & operator= (const QEvent &other)
 
void setAccepted (bool accepted)
 
bool spontaneous () const
 
Type type () const
 

Additional Inherited Members

- Public Types inherited from QEvent
enum  Type
 
- Static Public Methods inherited from QEvent
static int registerEventType (int hint=-1)
 

Detailed Description

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() method. 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);
}
Widget with status tip.

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("&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
QStatusBar, QHelpEvent, QWhatsThisClickedEvent

Constructor & Destructor Documentation

QStatusTipEvent::QStatusTipEvent ( const QString tip)
explicit

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

See also
tip()

Method Documentation

QString QStatusTipEvent::tip ( ) const
inline

Returns the message to show in the status bar.

See also
QStatusBar::showMessage()