Qt 4.8
|
The QActionEvent class provides an event that is generated when a QAction is added, removed, or changed. More...
#include <qevent.h>
Public Functions | |
QAction * | action () const |
Returns the action that is changed, added, or removed. More... | |
QAction * | before () const |
If type() is ActionAdded , returns the action that should appear before action(). More... | |
QActionEvent (int type, QAction *action, QAction *before=0) | |
Constructs an action event. More... | |
~QActionEvent () | |
Public Functions inherited from QEvent | |
void | accept () |
Sets the accept flag of the event object, the equivalent of calling setAccepted(true). More... | |
void | ignore () |
Clears the accept flag parameter of the event object, the equivalent of calling setAccepted(false). More... | |
bool | isAccepted () const |
QEvent (Type type) | |
Contructs an event object of type type. More... | |
void | setAccepted (bool accepted) |
bool | spontaneous () const |
Returns true if the event originated outside the application (a system event); otherwise returns false. More... | |
Type | type () const |
Returns the event type. More... | |
virtual | ~QEvent () |
Destroys the event. More... | |
Properties | |
QAction * | act |
QAction * | bef |
The QActionEvent class provides an event that is generated when a QAction is added, removed, or changed.
Actions can be added to widgets using QWidget::addAction(). This generates an ActionAdded event, which you can handle to provide custom behavior. For example, QToolBar reimplements QWidget::actionEvent() to create QToolButton for the actions.
Constructs an action event.
The type can be ActionChanged , ActionAdded , or ActionRemoved .
action is the action that is changed, added, or removed. If type is ActionAdded, the action is to be inserted before the action before. If before is 0, the action is appended.
Definition at line 3314 of file qevent.cpp.
QActionEvent::~QActionEvent | ( | ) |
Definition at line 3320 of file qevent.cpp.
|
inline |
Returns the action that is changed, added, or removed.
Definition at line 639 of file qevent.h.
Referenced by QMenuBar::actionEvent(), QMenu::actionEvent(), and QTornOffMenu::syncWithMenu().
|
inline |
If type() is ActionAdded , returns the action that should appear before action().
If this function returns 0, the action should be appended to already existing actions on the same widget.
Definition at line 640 of file qevent.h.
Referenced by QMenuBar::actionEvent(), QToolBar::actionEvent(), QMenu::actionEvent(), and QTornOffMenu::syncWithMenu().