Qyoto  4.0.5
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Properties
QtGui.QAction Class Reference

The QAction class provides an abstract user interface action that can be inserted into widgets. More...

Inheritance diagram for QtGui.QAction:
Collaboration diagram for QtGui.QAction:

Public Types

enum  ActionEvent { Hover = 1, Trigger = 0 }
  More...
 
enum  MenuRole {
  AboutQtRole = 3, AboutRole = 4, ApplicationSpecificRole = 2, NoRole = 0,
  PreferencesRole = 5, QuitRole = 6, TextHeuristicRole = 1
}
  More...
 
enum  Priority { HighPriority = 256, LowPriority = 0, NormalPriority = 128 }
  More...
 
enum  SoftKeyRole { NegativeSoftKey = 2, NoSoftKey = 0, PositiveSoftKey = 1, SelectSoftKey = 3 }
  More...
 

Public Member Functions

 QAction (QObject parent)
 
 
 QAction (QIcon icon, string text, QObject parent)
 
 
 QAction (string text, QObject parent)
 
 
override void CreateProxy ()
 
new void Activate (QAction.ActionEvent @event)
 
 
new
System.Collections.Generic.List
< QGraphicsWidget
AssociatedGraphicsWidgets ()
 
 
new
System.Collections.Generic.List
< QWidget
AssociatedWidgets ()
 
 
override bool OnEvent (QEvent arg1)
 
 
new void Hover ()
 
 
new bool IsSeparator ()
 
 
new QWidget ParentWidget ()
 
 
new void SetDisabled (bool b)
 
 
new void SetSeparator (bool b)
 
 
new void SetShortcuts (QKeySequence.StandardKey arg1)
 
 
new bool ShowStatusText (QWidget widget=null)
 
 
new void Toggle ()
 
 
new void Trigger ()
 
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
 
 
new bool BlockSignals (bool b)
 
 
new
System.Collections.Generic.List
< QObject
Children ()
 
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
new void DeleteLater ()
 
 
new bool Disconnect (QObject receiver, string member=null)
 
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
 
 
new void DumpObjectInfo ()
 
 
new void DumpObjectTree ()
 
 
new
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames ()
 
 
virtual bool EventFilter (QObject arg1, QEvent arg2)
 
 
new bool Inherits (string classname)
 
 
new void InstallEventFilter (QObject arg1)
 
 
new bool IsWidgetType ()
 
 
new void KillTimer (int id)
 
 
new object Property (string name)
 
 
new void RemoveEventFilter (QObject arg1)
 
 
new bool SetProperty (string name, object value)
 
 
new void SetUserData (uint id, QObjectUserData data)
 
new bool SignalsBlocked ()
 
 
new int StartTimer (int interval)
 
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 

Static Public Member Functions

static string Tr (string s, string c=null)
 
static string Tr (string s, string c, int n)
 
static string TrUtf8 (string s, string c=null)
 
static string TrUtf8 (string s, string c, int n)
 
- Static Public Member Functions inherited from QtCore.QObject
static bool Connect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod method, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
 
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType arg5=Qt.ConnectionType.AutoConnection)
 
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
 
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
 
 
static uint RegisterUserData ()
 
static string Tr (string s, string c=null)
 
 
static string Tr (string s, string c, int n)
 
 
static string TrUtf8 (string s, string c=null)
 
 
static string TrUtf8 (string s, string c, int n)
 
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream arg1, QSizeF arg2)
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream arg1, QPoint arg2)
 
static QDataStream Write (QDataStream arg1, QLineF arg2)
 
static QDataStream Write (QDataStream arg1, QPointF arg2)
 
static QDataStream Write (QDataStream arg1, QChar arg2)
 
static QDataStream Write (QDataStream arg1, QByteArray arg2)
 
static QDataStream Write (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Write (QDataStream arg1, QRectF arg2)
 
static QDataStream Write (QDataStream arg1, QDateTime arg2)
 
static QDataStream Write (QDataStream arg1, QUrl arg2)
 
static QDataStream Write (QDataStream arg1, QTime arg2)
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream arg1, QBitArray arg2)
 
static QDataStream Write (QDataStream arg1, QUuid arg2)
 
static QDataStream Write (QDataStream arg1, QLine arg2)
 
static QDataStream Write (QDataStream arg1, QDate arg2)
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
 
static QDataStream Write (QDataStream arg1, QRect arg2)
 
static QDataStream Write (QDataStream arg1, QSize arg2)
 
static QDataStream Write (QDataStream s, QVariant.Type p)
 
static QDataStream Write (QDataStream arg1, string arg2)
 
static QDataStream Write (QDataStream @out, System.Collections.Generic.List< string > list)
 
static QDataStream Read (QDataStream arg1, QChar arg2)
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream arg1, QRect arg2)
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream arg1, QDate arg2)
 
static QDataStream Read (QDataStream arg1, QUrl arg2)
 
static QDataStream Read (QDataStream arg1, QUuid arg2)
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream arg1, QLineF arg2)
 
static QDataStream Read (QDataStream arg1, QRectF arg2)
 
static QDataStream Read (QDataStream arg1, QPointF arg2)
 
static QDataStream Read (QDataStream arg1, QLine arg2)
 
static QDataStream Read (QDataStream arg1, QBitArray arg2)
 
static QDataStream Read (QDataStream arg1, QSize arg2)
 
static QDataStream Read (QDataStream arg1, QDateTime arg2)
 
static QDataStream Read (QDataStream arg1, QTime arg2)
 
static QDataStream Read (QDataStream arg1, QPoint arg2)
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream arg1, QByteArray arg2)
 
static QDataStream Read (QDataStream arg1, QSizeF arg2)
 
static QDataStream Read (QDataStream arg1, string arg2)
 
static QDataStream Read (QDataStream s, QVariant.Type p)
 
static QDataStream Read (QDataStream @in, System.Collections.Generic.List< string > list)
 
static double qAcos (double v)
 
static void qAddPostRoutine (System.Action arg1)
 
static string qAppName ()
 
static double qAsin (double v)
 
static double qAtan (double v)
 
static double qAtan2 (double x, double y)
 
static void qBadAlloc ()
 
static int qCeil (double v)
 
static ushort qChecksum (string s, uint len)
 
static QByteArray qCompress (QByteArray data)
 
static QByteArray qCompress (QByteArray data, int compressionLevel=-1)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes)
 
static QByteArray qCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
 
static double qCos (double v)
 
static double qExp (double v)
 
static double qFabs (double v)
 
static double qFastCos (double x)
 
static double qFastSin (double x)
 
static string qFlagLocation (string method)
 
static int qFloor (double v)
 
static bool qFuzzyCompare (double p1, double p2)
 
static bool qFuzzyCompare (float p1, float p2)
 
static bool qFuzzyIsNull (double d)
 
static bool qFuzzyIsNull (float f)
 
static uint qHash (QBitArray key)
 
static uint qHash (QChar key)
 
static uint qHash (QStringRef key)
 
static uint qHash (QUrl url)
 
static uint qHash (QPersistentModelIndex index)
 
static uint qHash (QByteArray key)
 
static uint qHash (QModelIndex index)
 
static uint qHash (uint key)
 
static uint qHash (sbyte key)
 
static uint qHash (byte key)
 
static uint qHash (short key)
 
static uint qHash (NativeLong key)
 
static uint qHash (ushort key)
 
static uint qHash (long key)
 
static uint qHash (ulong key)
 
static uint qHash (int key)
 
static uint qHash (string key)
 
static uint qHash (NativeULong key)
 
static double qInf ()
 
static Qt.ActionQtMsgTypeString qInstallMsgHandler (Qt.ActionQtMsgTypeString arg1)
 
static int qIntCast (float f)
 
static int qIntCast (double f)
 
static bool qIsFinite (double d)
 
static bool qIsFinite (float f)
 
static bool qIsInf (float f)
 
static bool qIsInf (double d)
 
static bool qIsNaN (float f)
 
static bool qIsNaN (double d)
 
static bool qIsNull (float f)
 
static bool qIsNull (double d)
 
static double qLn (double v)
 
static double qPow (double x, double y)
 
static double qQNaN ()
 
static void qRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
 
static void qRemovePostRoutine (System.Action arg1)
 
static int qRound (double d)
 
static long qRound64 (double d)
 
static double qSNaN ()
 
static bool qSharedBuild ()
 
static double qSin (double v)
 
static double qSqrt (double v)
 
static bool qStringComparisonHelper (QStringRef s1, string s2)
 
static double qTan (double v)
 
static QByteArray qUncompress (QByteArray data)
 
static QByteArray qUncompress (Pointer< byte > data, int nbytes)
 
static string qVersion ()
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
 
static bool Qputenv (string varName, QByteArray value)
 
static int Qrand ()
 
static void Qsrand (uint seed)
 
static int Qstrcmp (QByteArray str1, QByteArray str2)
 
static int Qstrcmp (QByteArray str1, string str2)
 
static int Qstrcmp (string str1, QByteArray str2)
 
static int Qstrcmp (string str1, string str2)
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
 
static Pointer< sbyte > Qstrdup (string arg1)
 
static int Qstricmp (string arg1, string arg2)
 
static uint Qstrlen (string str)
 
static int Qstrncmp (string str1, string str2, uint len)
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
 
static int Qstrnicmp (string arg1, string arg2, uint len)
 
static uint Qstrnlen (string str, uint maxlen)
 
static string QtTrId (string id, int n=-1)
 

Protected Member Functions

 QAction (System.Type dummy)
 
new void OnChanged ()
 
 
new void OnHovered ()
 
 
new void OnToggled (bool arg1)
 
 
new void OnTriggered (bool @checked=false)
 
 
- Protected Member Functions inherited from QtCore.QObject
 QObject (System.Type dummy)
 
virtual void OnChildEvent (QChildEvent arg1)
 
 
virtual void ConnectNotify (string signal)
 
 
virtual void OnCustomEvent (QEvent arg1)
 
 
new void OnDestroyed (QObject arg1=null)
 
 
virtual void DisconnectNotify (string signal)
 
 
new int Receivers (string signal)
 
 
new QObject Sender ()
 
 
new int SenderSignalIndex ()
 
 
virtual void OnTimerEvent (QTimerEvent arg1)
 
 

Properties

Slot Changed
 
 
Slot< System.Boolean > TriggeredChecked
 
Slot Triggered
 
 
Slot Hovered
 
 
Slot< System.Boolean > Toggled
 
 
Slot< System.Int32 > ActivatedInt32
 
Slot Activated
 
new QActionGroup ActionGroup [get, set]
 
 
new object Data [get, set]
 
 
new QMenu Menu [get, set]
 
 
new
System.Collections.Generic.List
< QKeySequence
Shortcuts [get, set]
 
 
new bool Checkable [get, set]
 
 
new bool Checked [get, set]
 
 
new bool Enabled [get, set]
 
 
new QIcon Icon [get, set]
 
 
new string Text [get, set]
 
 
new string IconText [get, set]
 
 
new string ToolTip [get, set]
 
 
new string StatusTip [get, set]
 
 
new string WhatsThis [get, set]
 
 
new QFont Font [get, set]
 
 
new QKeySequence Shortcut [get, set]
 
 
new Qt.ShortcutContext ShortcutContext [get, set]
 
 
new bool AutoRepeat [get, set]
 
 
new bool Visible [get, set]
 
 
new MenuRole menuRole [get, set]
 
 
new SoftKeyRole softKeyRole [get, set]
 
 
new bool IconVisibleInMenu [get, set]
 
 
new Priority priority [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
new IQActionSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
 
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
 
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
 
 
Slot< QObjectDestroyedQObject
 
Slot Destroyed
 
 
new QObject Parent [get, set]
 
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
 
 
static new QMetaObject StaticMetaObject [get]
 
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 

Additional Inherited Members

- Protected Attributes inherited from QtCore.QObject
object Q_EMIT = null
 
SmokeInvocation interceptor
 
readonly List< QEventHandler > eventFilters = new List<QEventHandler>()
 

Detailed Description

The QAction class provides an abstract user interface action that can be inserted into widgets.

In applications many common commands can be invoked via menus, toolbar buttons, and keyboard shortcuts. Since the user expects each command to be performed in the same way, regardless of the user interface used, it is useful to represent each command as an action.

Actions can be added to menus and toolbars, and will automatically keep them in sync. For example, in a word processor, if the user presses a Bold toolbar button, the Bold menu item will automatically be checked.

Actions can be created as independent objects, but they may also be created during the construction of menus; the QMenu class contains convenience functions for creating actions suitable for use as menu items.

A QAction may contain an icon, menu text, a shortcut, status text, "What's This?" text, and a tooltip. Most of these can be set in the constructor. They can also be set independently with setIcon(), setText(), setIconText(), setShortcut(), setStatusTip(), setWhatsThis(), and setToolTip(). For menu items, it is possible to set an individual font with setFont().

Actions are added to widgets using QWidget::addAction() or QGraphicsWidget::addAction(). Note that an action must be added to a widget before it can be used; this is also true when the shortcut should be global (i.e., Qt::ApplicationShortcut as Qt::ShortcutContext).

Once a QAction has been created it should be added to the relevant menu and toolbar, then connected to the slot which will perform the action. For example:

openAct = new QAction(QIcon(":/images/open.png"), tr("&Open..."), this);

openAct->setShortcuts(QKeySequence::Open);

openAct->setStatusTip(tr("Open an existing file"));

connect(openAct, SIGNAL(triggered()), this, SLOT(open()));

fileMenu->addAction(openAct);

fileToolBar->addAction(openAct);

We recommend that actions are created as children of the window they are used in. In most cases actions will be children of the application's main window.

See also QMenu, QToolBar, and Application Example.

Member Enumeration Documentation

This enum type is used when calling QAction::activate()

Enumerator:
Hover 

This will cause the QAction::hovered() signal to be emitted.

Trigger 

This will cause the QAction::triggered() signal to be emitted.

This enum describes how an action should be moved into the application menu on Mac OS X.

Setting this value only has effect on items that are in the immediate menus of the menubar, not the submenus of those menus. For example, if you have File menu in your menubar and the File menu has a submenu, setting the MenuRole for the actions in that submenu have no effect. They will never be moved.

Enumerator:
AboutQtRole 

This action matches handles the "About Qt" menu item.

AboutRole 

This action should be placed where the "About" menu item is in the application menu. The text of the menu item will be set to "About <application name>". The application name is fetched from the Info.plist file in the application's bundle (See Deploying an Application on Mac OS X).

ApplicationSpecificRole 

This action should be put in the application menu with an application specific role

NoRole 

This action should not be put into the application menu

PreferencesRole 

This action should be placed where the "Preferences..." menu item is in the application menu.

QuitRole 

This action should be placed where the Quit menu item is in the application menu.

TextHeuristicRole 

This action should be put in the application menu based on the action's text as described in the QMenuBar documentation.

This enum defines priorities for actions in user interface.

This enum was introduced or modified in Qt 4.6.

See also priority.

Enumerator:
HighPriority 

The action should be prioritized in the user interface.

LowPriority 

The action should not be prioritized in the user interface.

NormalPriority 

This enum describes how an action should be placed in the softkey bar. Currently this enum only has an effect on the Symbian platform.

Actions with a softkey role defined are only visible in the softkey bar when the widget containing the action has focus. If no widget currently has focus, the softkey framework will traverse up the widget parent hierarchy looking for a widget containing softkey actions.

This enum was introduced or modified in Qt 4.6.

Enumerator:
NegativeSoftKey 

This action is used to describe a soft ey with a negative or destructive role role such as Cancel, Discard, or Close.

NoSoftKey 

This action should not be used as a softkey

PositiveSoftKey 

This action is used to describe a softkey with a positive or non-destructive role such as Ok, Select, or Options.

SelectSoftKey 

This action is used to describe a role that selects a particular item or widget in the application.

Constructor & Destructor Documentation

QtGui.QAction.QAction ( System.Type  dummy)
protected
QtGui.QAction.QAction ( QObject  parent)

Constructs an action with parent. If parent is an action group the action will be automatically inserted into the group.

QtGui.QAction.QAction ( QIcon  icon,
string  text,
QObject  parent 
)

Constructs an action with an icon and some text and parent. If parent is an action group the action will be automatically inserted into the group.

The action uses a stripped version of text (e.g. "&Menu Option..." becomes "Menu Option") as descriptive text for tool buttons. You can override this by setting a specific description with setText(). The same text will be used for tooltips unless you specify a different text using setToolTip().

QtGui.QAction.QAction ( string  text,
QObject  parent 
)

Constructs an action with some text and parent. If parent is an action group the action will be automatically inserted into the group.

The action uses a stripped version of text (e.g. "&Menu Option..." becomes "Menu Option") as descriptive text for tool buttons. You can override this by setting a specific description with setText(). The same text will be used for tooltips unless you specify a different text using setToolTip().

Member Function Documentation

new void QtGui.QAction.Activate ( QAction.ActionEvent event)

Sends the relevant signals for ActionEvent event.

Action based widgets use this API to cause the QAction to emit signals as well as emitting their own.

new System.Collections.Generic.List<QGraphicsWidget> QtGui.QAction.AssociatedGraphicsWidgets ( )

Returns a list of widgets this action has been added to.

This function was introduced in Qt 4.5.

See also QWidget::addAction() and associatedWidgets().

new System.Collections.Generic.List<QWidget> QtGui.QAction.AssociatedWidgets ( )

Returns a list of widgets this action has been added to.

This function was introduced in Qt 4.2.

See also QWidget::addAction() and associatedGraphicsWidgets().

override void QtGui.QAction.CreateProxy ( )
virtual

Reimplemented from QtCore.QObject.

Reimplemented in QtGui.QWidgetAction.

new void QtGui.QAction.Dispose ( )
new void QtGui.QAction.Hover ( )

This is a convenience slot that calls activate(Hover).

new bool QtGui.QAction.IsSeparator ( )

Returns true if this action is a separator action; otherwise it returns false.

See also QAction::setSeparator().

new void QtGui.QAction.OnChanged ( )
protected

This signal is emitted when an action has changed. If you are only interested in actions in a given widget, you can watch for QWidget::actionEvent() sent with an QEvent::ActionChanged.

See also QWidget::actionEvent().

override bool QtGui.QAction.OnEvent ( QEvent  arg1)
virtual

Reimplemented from QObject::event().

Reimplemented from QtCore.QObject.

Reimplemented in QtGui.QWidgetAction.

new void QtGui.QAction.OnHovered ( )
protected

This signal is emitted when an action is highlighted by the user; for example, when the user pauses with the cursor over a menu option, toolbar button, or presses an action's shortcut key combination.

See also QAction::activate().

new void QtGui.QAction.OnToggled ( bool  arg1)
protected

This signal is emitted whenever a checkable action changes its isChecked() status. This can be the result of a user interaction, or because setChecked() was called.

checked is true if the action is checked, or false if the action is unchecked.

See also QAction::activate(), QAction::triggered(), and checked.

new void QtGui.QAction.OnTriggered ( bool @  checked = false)
protected

This signal is emitted when an action is activated by the user; for example, when the user clicks a menu option, toolbar button, or presses an action's shortcut key combination, or when trigger() was called. Notably, it is not emitted when setChecked() or toggle() is called.

If the action is checkable, checked is true if the action is checked, or false if the action is unchecked.

See also QAction::activate(), QAction::toggled(), and checked.

new QWidget QtGui.QAction.ParentWidget ( )

Returns the parent widget.

new void QtGui.QAction.SetDisabled ( bool  b)

This is a convenience function for the enabled property, that is useful for signals–slots connections. If b is true the action is disabled; otherwise it is enabled.

new void QtGui.QAction.SetSeparator ( bool  b)

If b is true then this action will be considered a separator.

How a separator is represented depends on the widget it is inserted into. Under most circumstances the text, submenu, and icon will be ignored for separator actions.

See also QAction::isSeparator().

new void QtGui.QAction.SetShortcuts ( QKeySequence.StandardKey  arg1)

Sets a platform dependent list of shortcuts based on the key. The result of calling this function will depend on the currently running platform. Note that more than one shortcut can assigned by this action. If only the primary shortcut is required, use setShortcut instead.

This function was introduced in Qt 4.2.

See also QKeySequence::keyBindings().

new bool QtGui.QAction.ShowStatusText ( QWidget  widget = null)

Updates the relevant status bar for the widget specified by sending a QStatusTipEvent to its parent widget. Returns true if an event was sent; otherwise returns false.

If a null widget is specified, the event is sent to the action's parent.

See also statusTip.

new void QtGui.QAction.Toggle ( )

This is a convenience function for the checked property. Connect to it to change the checked state to its opposite state.

static string QtGui.QAction.Tr ( string  s,
string  c = null 
)
static
static string QtGui.QAction.Tr ( string  s,
string  c,
int  n 
)
static
new void QtGui.QAction.Trigger ( )

This is a convenience slot that calls activate(Trigger).

static string QtGui.QAction.TrUtf8 ( string  s,
string  c = null 
)
static
static string QtGui.QAction.TrUtf8 ( string  s,
string  c,
int  n 
)
static

Property Documentation

new QActionGroup QtGui.QAction.ActionGroup
getset

Returns the action group for this action. If no action group manages this action then 0 will be returned.

Sets this action group to group. The action will be automatically added to the group's list of actions.

Actions within the group will be mutually exclusive.

Slot QtGui.QAction.Activated
addremove
Slot<System.Int32> QtGui.QAction.ActivatedInt32
addremove
new bool QtGui.QAction.AutoRepeat
getset

This property holds whether the action can auto repeat.

If true, the action will auto repeat when the keyboard shortcut combination is held down, provided that keyboard auto repeat is enabled on the system. The default value is true.

This property was introduced in Qt 4.2.

Slot QtGui.QAction.Changed
addremove

This signal is emitted when an action has changed. If you are only interested in actions in a given widget, you can watch for QWidget::actionEvent() sent with an QEvent::ActionChanged.

See also QWidget::actionEvent().

new bool QtGui.QAction.Checkable
getset

This property holds whether the action is a checkable action.

A checkable action is one which has an on/off state. For example, in a word processor, a Bold toolbar button may be either on or off. An action which is not a toggle action is a command action; a command action is simply executed, e.g. file save. By default, this property is false.

In some situations, the state of one toggle action should depend on the state of others. For example, "Left Align", "Center" and "Right Align" toggle actions are mutually exclusive. To achieve exclusive toggling, add the relevant toggle actions to a QActionGroup with the QActionGroup::exclusive property set to true.

new bool QtGui.QAction.Checked
getset

This property holds whether the action is checked.

Only checkable actions can be checked. By default, this is false (the action is unchecked).

new object QtGui.QAction.Data
getset

Returns the user data as set in QAction::setData.

Sets the action's internal data to the given userData.

new IQActionSignals QtGui.QAction.Emit
getprotected
new bool QtGui.QAction.Enabled
getset

This property holds whether the action is enabled.

Disabled actions cannot be chosen by the user. They do not disappear from menus or toolbars, but they are displayed in a way which indicates that they are unavailable. For example, they might be displayed using only shades of gray.

What's This? help on disabled actions is still available, provided that the QAction::whatsThis property is set.

An action will be disabled when all widgets to which it is added (with QWidget::addAction()) are disabled or not visible. When an action is disabled, it is not possible to trigger it through its shortcut.

By default, this property is true (actions are enabled).

new QFont QtGui.QAction.Font
getset

This property holds the action's font.

The font property is used to render the text set on the QAction. The font will can be considered a hint as it will not be consulted in all cases based upon application and style.

By default, this property contains the application's default font.

Slot QtGui.QAction.Hovered
addremove

This signal is emitted when an action is highlighted by the user; for example, when the user pauses with the cursor over a menu option, toolbar button, or presses an action's shortcut key combination.

See also QAction::activate().

new QIcon QtGui.QAction.Icon
getset

This property holds the action's icon.

In toolbars, the icon is used as the tool button icon; in menus, it is displayed to the left of the menu text. There is no default icon.

On Symbian the icons which are passed to softkeys, i.e. to actions with softkey role, need to have pixmap alpha channel correctly set otherwise drawing artifacts will appear when softkey is pressed down.

If a null icon (QIcon::isNull() is passed into this function, the icon of the action is cleared.

new string QtGui.QAction.IconText
getset

This property holds the action's descriptive icon text.

If QToolBar::toolButtonStyle is set to a value that permits text to be displayed, the text defined held in this property appears as a label in the relevant tool button.

It also serves as the default text in menus and tooltips if the action has not been defined with setText() or setToolTip(), and will also be used in toolbar buttons if no icon has been defined using setIcon().

If the icon text is not explicitly set, the action's normal text will be used for the icon text.

By default, this property contains an empty string.

new bool QtGui.QAction.IconVisibleInMenu
getset

This property holds whether or not an action should show an icon in a menu.

In some applications, it may make sense to have actions with icons in the toolbar, but not in menus. If true, the icon (if valid) is shown in the menu, when it is false, it is not shown.

The default is to follow whether the Qt::AA_DontShowIconsInMenus attribute is set for the application. Explicitly settings this property overrides the presence (or abscence) of the attribute.

For example:

QApplication app(argc, argv);

app.setAttribute(Qt::AA_DontShowIconsInMenus); // Icons are no longer shown in menus

// ...

QAction myAction = new QAction();

// ...

myAction->setIcon(SomeIcon);

myAction->setIconVisibleInMenu(true); // Icon *will be shown in menus for this action.

This property was introduced in Qt 4.4.

new QMenu QtGui.QAction.Menu
getset

Returns the menu contained by this action. Actions that contain menus can be used to create menu items with submenus, or inserted into toolbars to create buttons with popup menus.

Sets the menu contained by this action to the specified menu.

new MenuRole QtGui.QAction.menuRole
getset

This property holds the action's menu role.

This indicates what role the action serves in the application menu on Mac OS X. By default all action have the TextHeuristicRole, which means that the action is added based on its text (see QMenuBar for more information).

The menu role can only be changed before the actions are put into the menu bar in Mac OS X (usually just before the first application window is shown).

This property was introduced in Qt 4.2.

new Priority QtGui.QAction.priority
getset

This property holds the actions's priority in the user interface.

This property can be set to indicate how the action should be prioritized in the user interface.

For instance, when toolbars have the Qt::ToolButtonTextBesideIcon mode set, then actions with LowPriority will not show the text labels.

This property was introduced in Qt 4.6.

new QKeySequence QtGui.QAction.Shortcut
getset

This property holds the action's primary shortcut key.

Valid keycodes for this property can be found in Qt::Key and Qt::Modifier. There is no default shortcut key.

new Qt.ShortcutContext QtGui.QAction.ShortcutContext
getset

This property holds the context for the action's shortcut.

Valid values for this property can be found in Qt::ShortcutContext. The default value is Qt::WindowShortcut.

new System.Collections.Generic.List<QKeySequence> QtGui.QAction.Shortcuts
getset

Returns the list of shortcuts, with the primary shortcut as the first element of the list.

This function was introduced in Qt 4.2.

Sets shortcuts as the list of shortcuts that trigger the action. The first element of the list is the primary shortcut.

This function was introduced in Qt 4.2.

new SoftKeyRole QtGui.QAction.softKeyRole
getset

This property holds the action's softkey role.

This indicates what type of role this action describes in the softkey framework on platforms where such a framework is supported. Currently this is only supported on the Symbian platform.

The softkey role can be changed any time.

This property was introduced in Qt 4.6.

new QMetaObject QtGui.QAction.StaticMetaObject
staticget
new string QtGui.QAction.StatusTip
getset

This property holds the action's status tip.

The status tip is displayed on all status bars provided by the action's top-level parent widget.

By default, this property contains an empty string.

new string QtGui.QAction.Text
getset

This property holds the action's descriptive text.

If the action is added to a menu, the menu option will consist of the icon (if there is one), the text, and the shortcut (if there is one). If the text is not explicitly set in the constructor, or by using setText(), the action's description icon text will be used as text. There is no default text.

Slot<System.Boolean> QtGui.QAction.Toggled
addremove

This signal is emitted whenever a checkable action changes its isChecked() status. This can be the result of a user interaction, or because setChecked() was called.

checked is true if the action is checked, or false if the action is unchecked.

See also QAction::activate(), QAction::triggered(), and checked.

new string QtGui.QAction.ToolTip
getset

This property holds the action's tooltip.

This text is used for the tooltip. If no tooltip is specified, the action's text is used.

By default, this property contains the action's text.

Slot QtGui.QAction.Triggered
addremove

This signal is emitted when an action is activated by the user; for example, when the user clicks a menu option, toolbar button, or presses an action's shortcut key combination, or when trigger() was called. Notably, it is not emitted when setChecked() or toggle() is called.

If the action is checkable, checked is true if the action is checked, or false if the action is unchecked.

See also QAction::activate(), QAction::toggled(), and checked.

Slot<System.Boolean> QtGui.QAction.TriggeredChecked
addremove
new bool QtGui.QAction.Visible
getset

This property holds whether the action can be seen (e.g. in menus and toolbars).

If visible is true the action can be seen (e.g. in menus and toolbars) and chosen by the user; if visible is false the action cannot be seen or chosen by the user.

Actions which are not visible are not grayed out; they do not appear at all.

By default, this property is true (actions are visible).

new string QtGui.QAction.WhatsThis
getset

This property holds the action's "What's This?" help text.

The "What's This?" text is used to provide a brief description of the action. The text may contain rich text. There is no default "What's This?" text.