QActionEvent Class Reference

#include <qevent.h>

Inheritance diagram for QActionEvent:

Inheritance graph
[legend]
Collaboration diagram for QActionEvent:

Collaboration graph
[legend]
List of all members.

Detailed Description

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}s for the actions.

See also:
QAction, QWidget::addAction(), QWidget::removeAction(), QWidget::actions()

Definition at line 590 of file qevent.h.

Public Member Functions

 QActionEvent (int type, QAction *action, QAction *before=0)
 ~QActionEvent ()
QActionaction () const
QActionbefore () const

Private Attributes

QActionact
QActionbef


Constructor & Destructor Documentation

QActionEvent::QActionEvent ( int  type,
QAction action,
QAction before = 0 
)

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 2740 of file qevent.cpp.

02741     : QEvent(static_cast<QEvent::Type>(type)), act(action), bef(before)
02742 {}

QActionEvent::~QActionEvent (  ) 

Definition at line 2746 of file qevent.cpp.

02747 {
02748 }


Member Function Documentation

QAction * QActionEvent::action (  )  const [inline]

Returns the action that is changed, added, or removed.

See also:
before()

Definition at line 597 of file qevent.h.

Referenced by QMenuBar::actionEvent(), Q3ToolBar::actionEvent(), QMenu::actionEvent(), and QTornOffMenu::syncWithMenu().

00597 { return act; }

QAction * QActionEvent::before (  )  const [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.

See also:
action(), QWidget::actions()

Definition at line 598 of file qevent.h.

Referenced by QMenuBar::actionEvent(), QMenu::actionEvent(), and QTornOffMenu::syncWithMenu().

00598 { return bef; }


Member Data Documentation

QAction* QActionEvent::act [private]

Definition at line 592 of file qevent.h.

QAction * QActionEvent::bef [private]

Definition at line 592 of file qevent.h.


The documentation for this class was generated from the following files:
Generated on Thu Mar 15 16:49:22 2007 for Qt 4.2 User's Guide by  doxygen 1.5.1