Qyoto  4.0.7
Qyoto is a C# language binding for Qt
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator 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)
  More...
 
 QAction (QIcon icon, string text, QObject parent)
  More...
 
 QAction (string text, QObject parent)
  More...
 
override void CreateProxy ()
 
new void Activate (QAction.ActionEvent @event)
  More...
 
override bool OnEvent (QEvent e)
  More...
 
new void Hover ()
  More...
 
new void SetDisabled (bool b)
  More...
 
new void SetSeparator (bool b)
  More...
 
new void SetShortcuts (QKeySequence.StandardKey key)
  More...
 
new bool ShowStatusText (QWidget widget=null)
  More...
 
new void Toggle ()
  More...
 
new void Trigger ()
  More...
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.QObject
 QObject (QObject parent=null)
  More...
 
new bool BlockSignals (bool b)
  More...
 
new bool Connect (QObject sender, string signal, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
new void DeleteLater ()
  More...
 
new bool Disconnect (QObject receiver, string member=null)
  More...
 
new bool Disconnect (string signal=null, QObject receiver=null, string member=null)
  More...
 
new void DumpObjectInfo ()
  More...
 
new void DumpObjectTree ()
  More...
 
virtual bool EventFilter (QObject watched, QEvent @event)
  More...
 
new bool Inherits (string classname)
  More...
 
new void InstallEventFilter (QObject filterObj)
  More...
 
new void KillTimer (int id)
  More...
 
new object Property (string name)
  More...
 
new void RemoveEventFilter (QObject obj)
  More...
 
new bool SetProperty (string name, object value)
  More...
 
new void SetUserData (uint id, QObjectUserData data)
 
new int StartTimer (int interval)
  More...
 
new QObjectUserData UserData (uint id)
 
new void Dispose ()
 
- Public Member Functions inherited from QtCore.Qt
delegate QTextStream FuncQTextStreamQTextStream (QTextStream qTextStream)
 
delegate void ActionQtMsgTypeString (QtMsgType qtMsgType, string @string)
 
delegate QObject FuncQObject ()
 
delegate string FuncStringQByteArray (QByteArray qByteArray)
 
delegate QByteArray FuncQByteArrayString (string @string)
 

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)
  More...
 
static bool Connect (QObject sender, string signal, QObject receiver, string member, Qt.ConnectionType type=Qt.ConnectionType.AutoConnection)
  More...
 
static bool Disconnect (QObject sender, QMetaMethod signal, QObject receiver, QMetaMethod member)
  More...
 
static bool Disconnect (QObject sender, string signal, QObject receiver, string member)
  More...
 
static string Tr (string s, string c=null)
  More...
 
static string Tr (string s, string c, int n)
  More...
 
static string TrUtf8 (string s, string c=null)
  More...
 
static string TrUtf8 (string s, string c, int n)
  More...
 
- Static Public Member Functions inherited from QtCore.Qt
static QDataStream Write (QDataStream s, object p)
 
static QDataStream Write (QDataStream stream, QSizeF size)
  More...
 
static QDataStream Write (QDataStream stream, QPoint point)
  More...
 
static QTextStream Write (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Write (QDataStream stream, QLineF line)
  More...
 
static QDataStream Write (QDataStream stream, QPointF point)
  More...
 
static QDataStream Write (QDataStream @out, QChar chr)
  More...
 
static QDataStream Write (QDataStream @out, QByteArray ba)
  More...
 
static QDataStream Write (QDataStream stream, QEasingCurve easing)
  More...
 
static QDataStream Write (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Write (QDataStream @out, QDateTime dateTime)
  More...
 
static QDataStream Write (QDataStream @out, QUrl url)
  More...
 
static QDataStream Write (QDataStream @out, QTime time)
  More...
 
static QDataStream Write (QDataStream arg1, QLocale arg2)
 
static QDataStream Write (QDataStream @out, QBitArray ba)
  More...
 
static QDataStream Write (QDataStream s, QUuid id)
  More...
 
static QDataStream Write (QDataStream stream, QLine line)
  More...
 
static QDataStream Write (QDataStream @out, QDate date)
  More...
 
static QDataStream Write (QDataStream @out, QRegExp regExp)
  More...
 
static QDataStream Write (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Write (QDataStream stream, QSize size)
  More...
 
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)
  More...
 
static QDataStream Read (QDataStream @in, QChar chr)
  More...
 
static QDataStream Read (QDataStream arg1, QLocale arg2)
 
static QDataStream Read (QDataStream stream, QRect rectangle)
  More...
 
static QDataStream Read (QDataStream arg1, QEasingCurve arg2)
 
static QDataStream Read (QDataStream @in, QDate date)
  More...
 
static QDataStream Read (QDataStream @in, QUrl url)
  More...
 
static QDataStream Read (QDataStream s, QUuid id)
  More...
 
static QTextStream Read (QTextStream s, Qt.FuncQTextStreamQTextStream f)
 
static QDataStream Read (QDataStream stream, QLineF line)
  More...
 
static QDataStream Read (QDataStream stream, QRectF rectangle)
  More...
 
static QDataStream Read (QDataStream stream, QPointF point)
  More...
 
static QDataStream Read (QDataStream stream, QLine line)
  More...
 
static QDataStream Read (QDataStream @in, QBitArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSize size)
  More...
 
static QDataStream Read (QDataStream @in, QDateTime dateTime)
  More...
 
static QDataStream Read (QDataStream @in, QTime time)
  More...
 
static QDataStream Read (QDataStream stream, QPoint point)
  More...
 
static QDataStream Read (QDataStream @in, QRegExp regExp)
  More...
 
static QDataStream Read (QDataStream s, object p)
 
static QDataStream Read (QDataStream @in, QByteArray ba)
  More...
 
static QDataStream Read (QDataStream stream, QSizeF size)
  More...
 
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)
  More...
 
static double QAcos (double v)
  More...
 
static void QAddPostRoutine (System.Action ptr)
  More...
 
static double QAsin (double v)
  More...
 
static double QAtan (double v)
  More...
 
static double QAtan2 (double x, double y)
  More...
 
static void QBadAlloc ()
 
static int QCeil (double v)
  More...
 
static ushort QChecksum (string s, uint len)
  More...
 
static QByteArray QCompress (QByteArray data, int compressionLevel=-1)
  More...
 
static QByteArray QCompress (Pointer< byte > data, int nbytes, int compressionLevel=-1)
  More...
 
static double QCos (double v)
  More...
 
static double QExp (double v)
  More...
 
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)
  More...
 
static bool QFuzzyCompare (double p1, double p2)
  More...
 
static bool QFuzzyCompare (float p1, float p2)
  More...
 
static bool QFuzzyIsNull (double d)
 
static bool QFuzzyIsNull (float f)
 
static uint QHash (QBitArray key)
  More...
 
static uint QHash (QChar key)
  More...
 
static uint QHash (QStringRef key)
 
static uint QHash (QUrl url)
  More...
 
static uint QHash (QPersistentModelIndex index)
 
static uint QHash (QByteArray key)
  More...
 
static uint QHash (QModelIndex index)
 
static uint QHash (uint key)
  More...
 
static uint QHash (char key)
  More...
 
static uint QHash (byte key)
  More...
 
static uint QHash (short key)
  More...
 
static uint QHash (NativeLong key)
  More...
 
static uint QHash (ushort key)
  More...
 
static uint QHash (long key)
  More...
 
static uint QHash (ulong key)
  More...
 
static uint QHash (int key)
  More...
 
static uint QHash (string key)
  More...
 
static uint QHash (NativeULong key)
  More...
 
static Qt.ActionQtMsgTypeString QInstallMsgHandler (Qt.ActionQtMsgTypeString handler)
  More...
 
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)
  More...
 
static double QPow (double x, double y)
  More...
 
static void QRegisterStaticPluginInstanceFunction (Qt.FuncQObject function)
  More...
 
static void QRemovePostRoutine (System.Action arg1)
 
static int QRound (double d)
  More...
 
static long QRound64 (double d)
  More...
 
static double QSin (double v)
  More...
 
static double QSqrt (double v)
  More...
 
static bool QStringComparisonHelper (QStringRef s1, string s2)
 
static double QTan (double v)
  More...
 
static QByteArray QUncompress (QByteArray data)
  More...
 
static QByteArray QUncompress (Pointer< byte > data, int nbytes)
  More...
 
static void Qbswap_helper (Pointer< byte > src, Pointer< byte > dest, int size)
 
static QByteArray Qgetenv (string varName)
  More...
 
static bool Qputenv (string varName, QByteArray value)
  More...
 
static void Qsrand (uint seed)
  More...
 
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)
  More...
 
static Pointer< sbyte > Qstrcpy (Pointer< sbyte > dst, string src)
  More...
 
static Pointer< sbyte > Qstrdup (string src)
  More...
 
static int Qstricmp (string str1, string str2)
  More...
 
static uint Qstrlen (string str)
  More...
 
static int Qstrncmp (string str1, string str2, uint len)
  More...
 
static Pointer< sbyte > Qstrncpy (Pointer< sbyte > dst, string src, uint len)
  More...
 
static int Qstrnicmp (string str1, string str2, uint len)
  More...
 
static uint Qstrnlen (string str, uint maxlen)
  More...
 

Protected Member Functions

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

Properties

Slot Changed
  More...
 
Slot< System.Boolean > TriggeredChecked
  More...
 
Slot Triggered
  More...
 
Slot Hovered
  More...
 
Slot< System.Boolean > Toggled
  More...
 
Slot< System.Int32 > ActivatedInt32
  More...
 
Slot Activated
  More...
 
QActionGroup ActionGroup [get, set]
  More...
 
object Data [get, set]
  More...
 
QMenu Menu [get, set]
  More...
 
System.Collections.Generic.List
< QKeySequence
Shortcuts [get, set]
  More...
 
System.Collections.Generic.List
< QGraphicsWidget
AssociatedGraphicsWidgets [get]
  More...
 
System.Collections.Generic.List
< QWidget
AssociatedWidgets [get]
  More...
 
bool IsSeparator [get]
  More...
 
QWidget ParentWidget [get]
  More...
 
new bool Checkable [get, set]
  More...
 
new bool Checked [get, set]
  More...
 
new bool Enabled [get, set]
  More...
 
new QIcon Icon [get, set]
  More...
 
new string Text [get, set]
  More...
 
new string IconText [get, set]
  More...
 
new string ToolTip [get, set]
  More...
 
new string StatusTip [get, set]
  More...
 
new string WhatsThis [get, set]
  More...
 
new QFont Font [get, set]
  More...
 
new QKeySequence Shortcut [get, set]
  More...
 
new Qt.ShortcutContext ShortcutContext [get, set]
  More...
 
new bool AutoRepeat [get, set]
  More...
 
new bool Visible [get, set]
  More...
 
new MenuRole menuRole [get, set]
  More...
 
new SoftKeyRole softKeyRole [get, set]
  More...
 
new bool IconVisibleInMenu [get, set]
  More...
 
new Priority priority [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
 
new IQActionSignals Emit [get]
 
- Properties inherited from QtCore.QObject
virtual EventHandler
< QEventArgs< QChildEvent > > 
ChildEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
CustomEvent
  More...
 
virtual EventHandler
< QEventArgs< QEvent > > 
Event
  More...
 
virtual EventHandler
< QEventArgs< QTimerEvent > > 
TimerEvent
  More...
 
Slot< QObjectDestroyedObj
  More...
 
Slot Destroyed
  More...
 
QObject Parent [get, set]
  More...
 
System.Collections.Generic.List
< QObject
Children [get]
  More...
 
System.Collections.Generic.List
< QByteArray
DynamicPropertyNames [get]
  More...
 
bool IsWidgetType [get]
  More...
 
static uint RegisterUserData [get]
 
QObject Sender [get]
  More...
 
int SenderSignalIndex [get]
  More...
 
bool SignalsBlocked [get]
  More...
 
virtual System.IntPtr SmokeObject [get, set]
 
new string ObjectName [get, set]
  More...
 
static new QMetaObject StaticMetaObject [get]
  More...
 
static new QMetaObject StaticQtMetaObject [get]
 
new IQObjectSignals Emit [get]
 
- Properties inherited from QtCore.Qt
static string QAppName [get]
 
static double QInf [get]
 
static double QQNaN [get]
 
static double QSNaN [get]
 
static bool QSharedBuild [get]
 
static string QVersion [get]
  More...
 
static int Qrand [get]
  More...
 

Additional Inherited Members

- Static Public Attributes inherited from QtCore.Qt
</para > *< para > Creating QM
files suitable for use with
this[SmokeMethod("qtTrId(const
char*, int)")] static strin 
QtTrId )(string id, int n=-1)
 
- 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.

Here is the call graph for this function:

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().

Here is the call graph for this function:

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().

Here is the call graph for this function:

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.

override void QtGui.QAction.CreateProxy ( )
virtual

Reimplemented from QtCore.QObject.

Reimplemented in QtGui.QWidgetAction.

Here is the caller graph for this function:

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

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

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  e)
virtual

Reimplemented from QObject::event().

Reimplemented from QtCore.QObject.

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 @  checked)
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 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  key)

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

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

Use triggered() instead.

Slot<System.Int32> QtGui.QAction.ActivatedInt32
addremove

Use triggered() instead.

System.Collections.Generic.List<QGraphicsWidget> QtGui.QAction.AssociatedGraphicsWidgets
get

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().

System.Collections.Generic.List<QWidget> QtGui.QAction.AssociatedWidgets
get

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().

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).

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.

bool QtGui.QAction.IsSeparator
get

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

See also QAction::setSeparator().

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.

QWidget QtGui.QAction.ParentWidget
get

Returns the parent widget.

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.

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

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 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.