Quassel IRC  Pre-Release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros
ActionCollection Class Reference

#include </tmp/quassel/src/uisupport/actioncollection.h>

Signals

void inserted (QAction *action)
void actionHovered (QAction *action)
void actionTriggered (QAction *action)

Public Member Functions

 ActionCollection (QObject *parent)
virtual ~ActionCollection ()
void clear ()
 Clears the entire action collection, deleting all actions.
void associateWidget (QWidget *widget) const
 Associate all action in this collection to the given widget.
void addAssociatedWidget (QWidget *widget)
 Associate all actions in this collection to the given widget.
void removeAssociatedWidget (QWidget *widget)
QList< QWidget * > associatedWidgets () const
void clearAssociatedWidgets ()
void readSettings ()
void writeSettings () const
int count () const
bool isEmpty () const
QAction * action (int index) const
QAction * action (const QString &name) const
QList< QAction * > actions () const
QAction * addAction (const QString &name, QAction *action)
ActionaddAction (const QString &name, Action *action)
ActionaddAction (const QString &name, const QObject *receiver=0, const char *member=0)
void removeAction (QAction *action)
QAction * takeAction (QAction *action)
template<class ActionType >
ActionType * add (const QString &name, const QObject *receiver=0, const char *member=0)
 Create new action under the given name, add it to the collection and connect its triggered(bool) signal to the specified receiver.

Protected Slots

virtual void connectNotify (const char *signal)
virtual void slotActionTriggered ()

Private Slots

void slotActionHovered ()
void actionDestroyed (QObject *)
void associatedWidgetDestroyed (QObject *)

Private Member Functions

bool unlistAction (QAction *)

Private Attributes

QMap< QString, QAction * > _actionByName
QList< QAction * > _actions
QList< QWidget * > _associatedWidgets
bool _connectHovered
bool _connectTriggered

Detailed Description

Definition at line 38 of file actioncollection.h.

Constructor & Destructor Documentation

ActionCollection ( QObject *  parent)
explicit

Definition at line 33 of file actioncollection.cpp.

References _connectHovered, and _connectTriggered.

~ActionCollection ( )
virtual

Definition at line 39 of file actioncollection.cpp.

Member Function Documentation

void clear ( )

Clears the entire action collection, deleting all actions.

Definition at line 44 of file actioncollection.cpp.

References _actionByName, and _actions.

void associateWidget ( QWidget *  widget) const

Associate all action in this collection to the given widget.

Not that this only adds all current actions in the collection to that widget; subsequently added actions won't be added automatically.

Definition at line 241 of file actioncollection.cpp.

References action(), and actions().

void addAssociatedWidget ( QWidget *  widget)

Associate all actions in this collection to the given widget.

Subsequently added actions will be automagically associated with this widget as well.

Definition at line 250 of file actioncollection.cpp.

References _associatedWidgets, actions(), and associatedWidgetDestroyed().

Referenced by GraphicalUi::actionCollection().

void removeAssociatedWidget ( QWidget *  widget)
QList< QWidget * > associatedWidgets ( ) const

Definition at line 269 of file actioncollection.cpp.

References _associatedWidgets.

void clearAssociatedWidgets ( )

Definition at line 275 of file actioncollection.cpp.

References _associatedWidgets, action(), and actions().

int count ( ) const
inline

Definition at line 122 of file actioncollection.h.

References actions().

bool isEmpty ( ) const
inline

Definition at line 123 of file actioncollection.h.

References actions().

QAction * action ( const QString &  name) const

Definition at line 52 of file actioncollection.cpp.

References _actionByName.

Action * addAction ( const QString &  name,
Action action 
)

Definition at line 64 of file actioncollection.cpp.

References action(), and addAction().

Action * addAction ( const QString &  name,
const QObject *  receiver = 0,
const char *  member = 0 
)

Definition at line 73 of file actioncollection.cpp.

References addAction().

void removeAction ( QAction *  action)

Definition at line 130 of file actioncollection.cpp.

References takeAction().

QAction * takeAction ( QAction *  action)

Definition at line 136 of file actioncollection.cpp.

References _associatedWidgets, action(), and unlistAction().

Referenced by addAction(), and removeAction().

ActionType* add ( const QString &  name,
const QObject *  receiver = 0,
const char *  member = 0 
)
inline

Create new action under the given name, add it to the collection and connect its triggered(bool) signal to the specified receiver.

Definition at line 82 of file actioncollection.h.

References addAction().

Referenced by BufferWidget::BufferWidget(), and ChatViewSearchBar::ChatViewSearchBar().

void inserted ( QAction *  action)
signal

Referenced by addAction().

void actionHovered ( QAction *  action)
signal

Referenced by connectNotify(), and slotActionHovered().

void actionTriggered ( QAction *  action)
signal
void connectNotify ( const char *  signal)
protectedvirtualslot

Definition at line 208 of file actioncollection.cpp.

References actionHovered(), and actionTriggered().

void slotActionTriggered ( )
protectedvirtualslot

Definition at line 181 of file actioncollection.cpp.

References action(), and actionTriggered().

Referenced by addAction().

void slotActionHovered ( )
privateslot

Definition at line 189 of file actioncollection.cpp.

References action(), and actionHovered().

Referenced by addAction().

void actionDestroyed ( QObject *  obj)
privateslot

Definition at line 197 of file actioncollection.cpp.

References action(), and unlistAction().

Referenced by addAction().

void associatedWidgetDestroyed ( QObject *  obj)
privateslot

Definition at line 285 of file actioncollection.cpp.

References _associatedWidgets.

Referenced by addAssociatedWidget(), and removeAssociatedWidget().

bool unlistAction ( QAction *  action)
private

Definition at line 291 of file actioncollection.cpp.

References _actionByName, and _actions.

Referenced by actionDestroyed(), and takeAction().

Member Data Documentation

QMap<QString, QAction *> _actionByName
private

Definition at line 113 of file actioncollection.h.

Referenced by action(), addAction(), clear(), readSettings(), unlistAction(), and writeSettings().

QList<QAction *> _actions
private

Definition at line 114 of file actioncollection.h.

Referenced by actions(), addAction(), clear(), and unlistAction().

QList<QWidget *> _associatedWidgets
private
bool _connectHovered
private

Definition at line 117 of file actioncollection.h.

Referenced by ActionCollection(), and addAction().

bool _connectTriggered
private

Definition at line 118 of file actioncollection.h.

Referenced by ActionCollection(), and addAction().


The documentation for this class was generated from the following files: