- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files
- Directories
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | Friends

# QAction Class Reference

Search for all occurrences

## Detailed Description

Definition at line 64 of file qaction.h.

`#include <qaction.h>`

Inheritance diagram for QAction:
[legend]

List of all members.

## Public Types
enum | MenuRole { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole, AboutRole, PreferencesRole, QuitRole }
enum | SoftKeyRole { NoSoftKey, PositiveSoftKey, NegativeSoftKey, SelectSoftKey }
enum | Priority { LowPriority = 0, NormalPriority = 128, HighPriority = 256 }
enum | ActionEvent { Trigger, Hover }
## Public Slots
void | trigger ()
void | hover ()
void | setChecked (bool)
void | toggle ()
void | setEnabled (bool)
void | setDisabled (bool b)
void | setVisible (bool)
## Signals
void | changed ()
void | triggered (bool checked=false)
void | hovered ()
void | toggled (bool)
## Public Member Functions
| QAction (QObject *parent)
| QAction (const QString &text, QObject *parent)
| QAction (const QIcon &icon, const QString &text, QObject *parent)
| ~QAction ()
void | setActionGroup (QActionGroup *group)
QActionGroup * | actionGroup () const
void | setIcon (const QIcon &icon)
QIcon | icon () const
void | setText (const QString &text)
QString | text () const
void | setIconText (const QString &text)
QString | iconText () const
void | setToolTip (const QString &tip)
QString | toolTip () const
void | setStatusTip (const QString &statusTip)
QString | statusTip () const
void | setWhatsThis (const QString &what)
QString | whatsThis () const
void | setPriority (Priority priority)
Priority | priority () const
QMenu * | menu () const
void | setMenu (QMenu *menu)
void | setSeparator (bool b)
bool | isSeparator () const
void | setShortcut (const QKeySequence &shortcut)
QKeySequence | shortcut () const
void | setShortcuts (const QList< QKeySequence > &shortcuts)
void | setShortcuts (QKeySequence::StandardKey)
QList< QKeySequence > | shortcuts () const
void | setShortcutContext (Qt::ShortcutContext context)
Qt::ShortcutContext | shortcutContext () const
void | setAutoRepeat (bool)
bool | autoRepeat () const
void | setFont (const QFont &font)
QFont | font () const
void | setCheckable (bool)
bool | isCheckable () const
QVariant | data () const
void | setData (const QVariant &var)
bool | isChecked () const
bool | isEnabled () const
bool | isVisible () const
void | activate (ActionEvent event)
bool | showStatusText (QWidget *widget=0)
void | setMenuRole (MenuRole menuRole)
MenuRole | menuRole () const
void | setSoftKeyRole (SoftKeyRole softKeyRole)
SoftKeyRole | softKeyRole () const
void | setIconVisibleInMenu (bool visible)
bool | isIconVisibleInMenu () const
QWidget * | parentWidget () const
QList< QWidget * > | associatedWidgets () const
QList< QGraphicsWidget * > | associatedGraphicsWidgets () const
## Protected Member Functions
bool | event (QEvent *)
| QAction (QActionPrivate &dd, QObject *parent)
## Properties
bool | checkable
bool | checked
bool | enabled
QIcon | icon
QString | text
QString | iconText
QString | toolTip
QString | statusTip
QString | whatsThis
QFont | font
QKeySequence | shortcut
Qt::ShortcutContext | shortcutContext
bool | autoRepeat
bool | visible
MenuRole | menuRole
SoftKeyRole | softKeyRole
bool | iconVisibleInMenu
Priority | priority
## Friends
class | QGraphicsWidget
class | QWidget
class | QActionGroup
class | QMenu
class | QMenuPrivate
class | QMenuBar
class | QShortcutMap
class | QToolButton

## Member Enumeration Documentation

enum MenuRole

Search for all occurrences

Enumerator:

  NoRole | Search for all occurrences
  TextHeuristicRole | Search for all occurrences
  ApplicationSpecificRole | Search for all occurrences
  AboutQtRole | Search for all occurrences
  AboutRole | Search for all occurrences
  PreferencesRole | Search for all occurrences
  QuitRole | Search for all occurrences

Definition at line 94 of file qaction.h.

                      { NoRole, TextHeuristicRole, ApplicationSpecificRole, AboutQtRole,
                        AboutRole, PreferencesRole, QuitRole };

enum SoftKeyRole

Search for all occurrences

Enumerator:

  NoSoftKey | Search for all occurrences
  PositiveSoftKey | Search for all occurrences
  NegativeSoftKey | Search for all occurrences
  SelectSoftKey | Search for all occurrences

Definition at line 96 of file qaction.h.

                         {
                        NoSoftKey, PositiveSoftKey, NegativeSoftKey, SelectSoftKey };

enum Priority

Search for all occurrences

Enumerator:

  LowPriority | Search for all occurrences
  NormalPriority | Search for all occurrences
  HighPriority | Search for all occurrences

Definition at line 98 of file qaction.h.

                      { LowPriority = 0,
                        NormalPriority = 128,
                        HighPriority = 256};

enum ActionEvent

Search for all occurrences

Enumerator:

  Trigger | Search for all occurrences
  Hover | Search for all occurrences

Definition at line 176 of file qaction.h.

    { Trigger, Hover };

## Constructor & Destructor Documentation

QAction | ( | QObject * | parent | ) | `[explicit]`

QAction | ( | const QString & | text,
|  | QObject * | parent
| ) |  |

QAction | ( | const QIcon & | icon,
|  | const QString & | text,
|  | QObject * | parent
| ) |  |

~QAction | ( |  | ) |

QAction | ( | QActionPrivate & | dd,
|  | QObject * | parent
| ) |  | `[protected]`

## Member Function Documentation

void setActionGroup | ( | QActionGroup * | group | ) |

Search for all occurrences

QActionGroup* actionGroup | ( |  | ) | const

Search for all occurrences

void setIcon | ( | const QIcon & | icon | ) |

Search for all occurrences

QIcon icon | ( |  | ) | const

Search for all occurrences

void setText | ( | const QString & | text | ) |

Search for all occurrences

QString text | ( |  | ) | const

Search for all occurrences

void setIconText | ( | const QString & | text | ) |

Search for all occurrences

QString iconText | ( |  | ) | const

Search for all occurrences

void setToolTip | ( | const QString & | tip | ) |

Search for all occurrences

QString toolTip | ( |  | ) | const

Search for all occurrences

void setStatusTip | ( | const QString & | statusTip | ) |

Search for all occurrences

QString statusTip | ( |  | ) | const

Search for all occurrences

void setWhatsThis | ( | const QString & | what | ) |

Search for all occurrences

QString whatsThis | ( |  | ) | const

Search for all occurrences

void setPriority | ( | Priority | priority | ) |

Search for all occurrences

Priority priority | ( |  | ) | const

Search for all occurrences

QMenu* menu | ( |  | ) | const

Search for all occurrences

void setMenu | ( | QMenu * | menu | ) |

Search for all occurrences

void setSeparator | ( | bool | b | ) |

Search for all occurrences

bool isSeparator | ( |  | ) | const

Search for all occurrences

void setShortcut | ( | const QKeySequence & | shortcut | ) |

Search for all occurrences

QKeySequence shortcut | ( |  | ) | const

Search for all occurrences

void setShortcuts | ( | const QList< QKeySequence > & | shortcuts | ) |

Search for all occurrences

void setShortcuts | ( | QKeySequence::StandardKey |  | ) |

Search for all occurrences

QList<QKeySequence> shortcuts | ( |  | ) | const

Search for all occurrences

void setShortcutContext | ( | Qt::ShortcutContext | context | ) |

Search for all occurrences

Qt::ShortcutContext shortcutContext | ( |  | ) | const

Search for all occurrences

void setAutoRepeat | ( | bool |  | ) |

Search for all occurrences

bool autoRepeat | ( |  | ) | const

Search for all occurrences

void setFont | ( | const QFont & | font | ) |

Search for all occurrences

QFont font | ( |  | ) | const

Search for all occurrences

void setCheckable | ( | bool |  | ) |

Search for all occurrences

bool isCheckable | ( |  | ) | const

Search for all occurrences

QVariant data | ( |  | ) | const

Search for all occurrences

void setData | ( | const QVariant & | var | ) |

Search for all occurrences

bool isChecked | ( |  | ) | const

Search for all occurrences

bool isEnabled | ( |  | ) | const

Search for all occurrences

bool isVisible | ( |  | ) | const

Search for all occurrences

void activate | ( | ActionEvent | event | ) |

Search for all occurrences

bool showStatusText | ( | QWidget * | widget = `0` | ) |

Search for all occurrences

void setMenuRole | ( | MenuRole | menuRole | ) |

Search for all occurrences

MenuRole menuRole | ( |  | ) | const

Search for all occurrences

void setSoftKeyRole | ( | SoftKeyRole | softKeyRole | ) |

Search for all occurrences

SoftKeyRole softKeyRole | ( |  | ) | const

Search for all occurrences

void setIconVisibleInMenu | ( | bool | visible | ) |

Search for all occurrences

bool isIconVisibleInMenu | ( |  | ) | const

Search for all occurrences

QWidget* parentWidget | ( |  | ) | const

Search for all occurrences

QList<QWidget *> associatedWidgets | ( |  | ) | const

Search for all occurrences

QList<QGraphicsWidget *> associatedGraphicsWidgets | ( |  | ) | const

Search for all occurrences

bool event | ( | QEvent * |  | ) | `[protected, virtual]`

Search for all occurrences

Reimplemented from QObject.

Reimplemented in QWidgetAction.

void trigger | ( |  | ) | `[inline, slot]`

Search for all occurrences

Definition at line 218 of file qaction.h.

    { activate(Trigger); }

void hover | ( |  | ) | `[inline, slot]`

Search for all occurrences

Definition at line 219 of file qaction.h.

    { activate(Hover); }

void setChecked | ( | bool |  | ) | `[slot]`

Search for all occurrences

void toggle | ( |  | ) | `[slot]`

Search for all occurrences

void setEnabled | ( | bool |  | ) | `[slot]`

Search for all occurrences

void setDisabled | ( | bool | b | ) | `[inline, slot]`

Search for all occurrences

Definition at line 223 of file qaction.h.

    { setEnabled(!b); }

void setVisible | ( | bool |  | ) | `[slot]`

Search for all occurrences

void changed | ( |  | ) | `[signal]`

Search for all occurrences

void triggered | ( | bool | checked = `false` | ) | `[signal]`

Search for all occurrences

void hovered | ( |  | ) | `[signal]`

Search for all occurrences

void toggled | ( | bool |  | ) | `[signal]`

Search for all occurrences

## Friends And Related Function Documentation

friend class QGraphicsWidget `[friend]`

Search for all occurrences

Definition at line 241 of file qaction.h.

friend class QWidget `[friend]`

Search for all occurrences

Reimplemented from QObject.

Definition at line 242 of file qaction.h.

friend class QActionGroup `[friend]`

Search for all occurrences

Definition at line 243 of file qaction.h.

friend class QMenu `[friend]`

Search for all occurrences

Definition at line 244 of file qaction.h.

friend class QMenuPrivate `[friend]`

Search for all occurrences

Definition at line 245 of file qaction.h.

friend class QMenuBar `[friend]`

Search for all occurrences

Definition at line 246 of file qaction.h.

friend class QShortcutMap `[friend]`

Search for all occurrences

Definition at line 247 of file qaction.h.

friend class QToolButton `[friend]`

Search for all occurrences

Definition at line 248 of file qaction.h.

## Property Documentation

bool checkable `[read, write]`

Search for all occurrences

Definition at line 72 of file qaction.h.

bool checked `[read, write]`

Search for all occurrences

Definition at line 73 of file qaction.h.

bool enabled `[read, write]`

Search for all occurrences

Definition at line 74 of file qaction.h.

QIcon icon `[read, write]`

Search for all occurrences

Definition at line 75 of file qaction.h.

QString text `[read, write]`

Search for all occurrences

Definition at line 76 of file qaction.h.

QString iconText `[read, write]`

Search for all occurrences

Definition at line 77 of file qaction.h.

QString toolTip `[read, write]`

Search for all occurrences

Definition at line 78 of file qaction.h.

QString statusTip `[read, write]`

Search for all occurrences

Definition at line 79 of file qaction.h.

QString whatsThis `[read, write]`

Search for all occurrences

Definition at line 80 of file qaction.h.

QFont font `[read, write]`

Search for all occurrences

Definition at line 81 of file qaction.h.

QKeySequence shortcut `[read, write]`

Search for all occurrences

Definition at line 83 of file qaction.h.

Qt::ShortcutContext shortcutContext `[read, write]`

Search for all occurrences

Definition at line 84 of file qaction.h.

bool autoRepeat `[read, write]`

Search for all occurrences

Definition at line 85 of file qaction.h.

bool visible `[read, write]`

Search for all occurrences

Definition at line 87 of file qaction.h.

MenuRole menuRole `[read, write]`

Search for all occurrences

Definition at line 88 of file qaction.h.

SoftKeyRole softKeyRole `[read, write]`

Search for all occurrences

Definition at line 89 of file qaction.h.

bool iconVisibleInMenu `[read, write]`

Search for all occurrences

Definition at line 90 of file qaction.h.

Priority priority `[read, write]`

Search for all occurrences

Definition at line 91 of file qaction.h.

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

- QtGui/qaction.h

QAction QAction QAction QAction QAction QAction QAction QAction QAction QAction
QAction QAction QAction QAction QAction QAction QAction QAction QAction QAction