CopperSpice API  1.7.2
QAction Class Reference

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

Inheritance diagram for QAction:
QObject QWidgetAction

Public Types

enum  ActionEvent
 
enum  MenuRole
 
enum  Priority
 

Public Signals

void changed ()
 
void hovered ()
 
void toggled (bool checked)
 
void triggered (bool checked=false)
 
- Public Signals inherited from QObject
void destroyed (QObject *obj=nullptr)
 
void objectNameChanged (const QString &objectName)
 

Public Slots

void hover ()
 
void setChecked (bool checked)
 
void setDisabled (bool b)
 
void setEnabled (bool b)
 
void setVisible (bool b)
 
void toggle ()
 
void trigger ()
 
- Public Slots inherited from QObject
void deleteLater ()
 

Public Methods

 QAction (const QIcon &icon, const QString &text, QObject *parent)
 
 QAction (const QString &text, QObject *parent)
 
 QAction (QObject *parent)
 
 ~QAction ()
 
QActionGroupactionGroup () const
 
void activate (ActionEvent event)
 
QList< QGraphicsWidget * > associatedGraphicsWidgets () const
 
QList< QWidget * > associatedWidgets () const
 
bool autoRepeat () const
 
QVariant data () const
 
QFont font () const
 
QIcon icon () const
 
QString iconText () const
 
bool isCheckable () const
 
bool isChecked () const
 
bool isEnabled () const
 
bool isIconVisibleInMenu () const
 
bool isSeparator () const
 
bool isVisible () const
 
QMenumenu () const
 
MenuRole menuRole () const
 
QWidgetparentWidget () const
 
Priority priority () const
 
void setActionGroup (QActionGroup *group)
 
void setAutoRepeat (bool)
 
void setCheckable (bool)
 
void setData (const QVariant &data)
 
void setFont (const QFont &font)
 
void setIcon (const QIcon &icon)
 
void setIconText (const QString &text)
 
void setIconVisibleInMenu (bool visible)
 
void setMenu (QMenu *menu)
 
void setMenuRole (MenuRole menuRole)
 
void setPriority (Priority priority)
 
void setSeparator (bool b)
 
void setShortcut (const QKeySequence &shortcut)
 
void setShortcutContext (Qt::ShortcutContext context)
 
void setShortcuts (const QList< QKeySequence > &shortcuts)
 
void setShortcuts (QKeySequence::StandardKey key)
 
void setStatusTip (const QString &statusTip)
 
void setText (const QString &text)
 
void setToolTip (const QString &tip)
 
void setWhatsThis (const QString &what)
 
QKeySequence shortcut () const
 
Qt::ShortcutContext shortcutContext () const
 
QList< QKeySequenceshortcuts () const
 
bool showStatusText (QWidget *widget=nullptr)
 
QString statusTip () const
 
QString text () const
 
QString toolTip () const
 
QString whatsThis () const
 
- Public Methods inherited from QObject
 QObject (QObject *parent=nullptr)
 
 ~QObject ()
 
bool blockSignals (bool block)
 
const QList< QObject * > & children () const
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool connect (const QObject *sender, const QString &signalMethod, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
bool disconnect (const QObject *receiver, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod, const QString &location, const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
bool disconnect (const QString &signalMethod=QString (), const QObject *receiver=nullptr, const QString &slotMethod=QString ()) const
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QStringdynamicPropertyNames () const
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
template<typename T >
findChild (const QString &childName=QString ()) const
 
template<class T >
QList< T > findChildren (const QRegularExpression &regExp, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
template<class T >
QList< T > findChildren (const QString &objName=QString (), Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 
bool inherits (const QString &className) const
 
void installEventFilter (QObject *filterObj)
 
bool isWidgetType () const
 
bool isWindowType () const
 
void killTimer (int id)
 
const QMetaObjectmetaObject () const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const
 
QObject * parent () const
 
template<class T = QVariant>
property (const QString &name) const
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const QString &name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 
QThreadthread () const
 

Protected Methods

bool event (QEvent *event) override
 
- Protected Methods inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signalMethod) const
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signalMethod) const
 
bool isSignalConnected (const QMetaMethod &signalMethod) const
 
int receivers (const QString &signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 

Properties

 autoRepeat
 
 checkable
 
 checked
 
 enabled
 
 font
 
 icon
 
 iconText
 
 iconVisibleInMenu
 
 menuRole
 
 priority
 
 shortcut
 
 shortcutContext
 
 statusTip
 
 text
 
 toolTip
 
 visible
 
 whatsThis
 
- Properties inherited from QObject
 objectName
 

Friends

class QActionGroup
 
class QGraphicsWidget
 
class QMenu
 
class QMenuBar
 
class QToolButton
 
class QWidget
 

Additional Inherited Members

- Static Public Methods inherited from QObject
static bool connect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool connect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection, const QString &location=QString ())
 
static bool connect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod, Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...), Qt::ConnectionType type=Qt::AutoConnection)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool connect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotLambda, Qt::ConnectionType type=Qt::AutoConnection)
 
static bool disconnect (const QObject *sender, const QMetaMethod &signalMethod, const QObject *receiver, const QMetaMethod &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QObject *receiver, const QString &slotMethod)
 
static bool disconnect (const QObject *sender, const QString &signalMethod, const QString &location, const QObject *receiver, const QString &slotMethod)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class SlotClass , class... SlotArgs, class SlotReturn >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, SlotReturn (SlotClass::*slotMethod)(SlotArgs...))
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, std::nullptr_t slotMethod=nullptr)
 
template<class Sender , class SignalClass , class... SignalArgs, class Receiver , class T >
static bool disconnect (const Sender *sender, void (SignalClass::*signalMethod)(SignalArgs...), const Receiver *receiver, T slotMethod)
 
static QMetaObjectstaticMetaObject ()
 
static QString tr (const char *text, const char *comment=nullptr, std::optional< int > numArg=std::optional< int >())
 

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

Member Enumeration Documentation

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

ConstantValueDescription
QAction::Trigger0this will cause the QAction::triggered() signal to be emitted.
QAction::Hover1this will cause the QAction::hovered() signal to be emitted.

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

ConstantValueDescription
QAction::NoRole0This action should not be put into the application menu
QAction::TextHeuristicRole1 This action should be put in the application menu based on the action's text as described in the QMenuBar documentation.
QAction::ApplicationSpecificRole2 This action should be put in the application menu with an application specific role
QAction::AboutCsRole3 This action matches handles the "About CopperSpice" menu item.
QAction::AboutRole4 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.
QAction::PreferencesRole5 This action should be placed where the "Preferences..." menu item is in the application menu.
QAction::QuitRole6 This action should be placed where the Quit menu item is in the application menu.

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.

This enum defines priorities for actions in user interface.

ConstantValueDescription
QAction::LowPriority0The action should not be prioritized in the user interface.
QAction::NormalPriority128 
QAction::HighPriority256The action should be prioritized in the user interface.
See also
priority

Constructor & Destructor Documentation

QAction::QAction ( QObject parent)
explicit

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

QAction::QAction ( const QString 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().

QAction::QAction ( const QIcon icon,
const QString 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().

QAction::~QAction ( )

Destroys the object and frees allocated resources.

Method Documentation

QActionGroup * QAction::actionGroup ( ) const

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

See also
QActionGroup, QAction::setActionGroup()
void QAction::activate ( 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.

QList< QGraphicsWidget * > QAction::associatedGraphicsWidgets ( ) const

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

See also
QWidget::addAction(), associatedWidgets()
QList< QWidget * > QAction::associatedWidgets ( ) const

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

See also
QWidget::addAction(), associatedGraphicsWidgets()
bool QAction::autoRepeat ( ) const

Property documentation pending.

void QAction::changed ( )
signal

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()
QVariant QAction::data ( ) const

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

See also
setData()
bool QAction::event ( QEvent event)
overrideprotectedvirtual

Reimplemented from QObject::event().

Reimplemented from QObject.

Reimplemented in QWidgetAction.

QFont QAction::font ( ) const

Property documentation pending.

void QAction::hover ( )
inlineslot

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

void QAction::hovered ( )
signal

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()
QIcon QAction::icon ( ) const

Property documentation pending.

QString QAction::iconText ( ) const

Property documentation pending.

bool QAction::isCheckable ( ) const

Property documentation pending.

bool QAction::isChecked ( ) const

Property documentation pending.

bool QAction::isEnabled ( ) const

Property documentation pending.

bool QAction::isIconVisibleInMenu ( ) const

Property documentation pending.

bool QAction::isSeparator ( ) const

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

See also
QAction::setSeparator()
bool QAction::isVisible ( ) const

Property documentation pending.

QMenu * QAction::menu ( ) const

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.

See also
setMenu(), QMenu::addAction()
MenuRole QAction::menuRole ( ) const

Property documentation pending.

QWidget * QAction::parentWidget ( ) const

Returns the parent widget.

Priority QAction::priority ( ) const

Property documentation pending.

void QAction::setActionGroup ( QActionGroup group)

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.

See also
QActionGroup, QAction::actionGroup()
void QAction::setAutoRepeat ( bool  )

Property documentation pending.

void QAction::setCheckable ( bool  )

Property documentation pending.

void QAction::setChecked ( bool  checked)
slot

Property documentation pending.

void QAction::setData ( const QVariant data)

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

See also
data()
void QAction::setDisabled ( bool  b)
inlineslot

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

void QAction::setEnabled ( bool  b)
slot

Property documentation pending.

void QAction::setFont ( const QFont font)

Property documentation pending.

void QAction::setIcon ( const QIcon icon)

Property documentation pending.

void QAction::setIconText ( const QString text)

Property documentation pending.

void QAction::setIconVisibleInMenu ( bool  visible)

Property documentation pending.

void QAction::setMenu ( QMenu menu)

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

See also
menu()
void QAction::setMenuRole ( MenuRole  menuRole)

Property documentation pending.

void QAction::setPriority ( Priority  priority)

Property documentation pending.

void 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()
void QAction::setShortcut ( const QKeySequence shortcut)

Property documentation pending.

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

Property documentation pending.

void QAction::setShortcuts ( const QList< QKeySequence > &  shortcuts)

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

See also
shortcuts(), shortcut
void 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.

See also
QKeySequence::keyBindings()
void QAction::setStatusTip ( const QString statusTip)

Property documentation pending.

void QAction::setText ( const QString text)

Property documentation pending.

void QAction::setToolTip ( const QString tip)

Property documentation pending.

void QAction::setVisible ( bool  b)
slot

Property documentation pending.

void QAction::setWhatsThis ( const QString what)

Property documentation pending.

QKeySequence QAction::shortcut ( ) const

Property documentation pending.

Qt::ShortcutContext QAction::shortcutContext ( ) const

Property documentation pending.

QList< QKeySequence > QAction::shortcuts ( ) const

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

See also
setShortcuts()
bool QAction::showStatusText ( QWidget widget = nullptr)

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
QString QAction::statusTip ( ) const

Property documentation pending.

QString QAction::text ( ) const

Property documentation pending.

void QAction::toggle ( )
slot

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

void QAction::toggled ( bool  checked)
signal

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. The value for checked is true if the action is checked, or false if the action is unchecked.

See also
QAction::activate(), QAction::triggered(), checked
QString QAction::toolTip ( ) const

Property documentation pending.

void QAction::trigger ( )
inlineslot

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

void QAction::triggered ( bool  checked = false)
signal

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 then checked is true if the action is checked, or false if the action is unchecked.

See also
QAction::activate(), QAction::toggled(), checked
QString QAction::whatsThis ( ) const

Property documentation pending.

Property Documentation

QAction::autoRepeat

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.

PropertiesClass Methods
read autoRepeat
write setAutoRepeat
notify changed
QAction::checkable

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.

See also
QAction::setChecked()
PropertiesClass Methods
read isCheckable
write setCheckable
notify changed
QAction::checked

This property holds whether the action is checked.

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

See also
checkable
PropertiesClass Methods
read isChecked
write setChecked
QAction::enabled

This property holds whether the action is enabled.

Disabled actions can not 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).

See also
text
PropertiesClass Methods
read isEnabled
write setEnabled
notify changed
QAction::font

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.

See also
QAction::setText(), QStyle
PropertiesClass Methods
read font
write setFont
notify changed
QAction::icon

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.

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

PropertiesClass Methods
read icon
write setIcon
notify changed
QAction::iconText

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.

See also
setToolTip(), setStatusTip()
PropertiesClass Methods
read iconText
write setIconText
notify changed
QAction::iconVisibleInMenu

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 absence) 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.
See also
QAction::icon, QApplication::setAttribute()
PropertiesClass Methods
read isIconVisibleInMenu
write setIconVisibleInMenu
notify changed
QAction::menuRole

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

PropertiesClass Methods
read menuRole
write setMenuRole
notify changed
QAction::priority

This property holds the action'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.

PropertiesClass Methods
read priority
write setPriority
QAction::shortcut

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.

PropertiesClass Methods
read shortcut
write setShortcut
notify changed
QAction::shortcutContext

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.

PropertiesClass Methods
read shortcutContext
write setShortcutContext
notify changed
QAction::statusTip

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.

See also
setToolTip(), showStatusText()
PropertiesClass Methods
read statusTip
write setStatusTip
notify changed
QAction::text

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.

See also
iconText
PropertiesClass Methods
read text
write setText
notify changed
QAction::toolTip

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.

See also
setStatusTip(), setShortcut()
PropertiesClass Methods
read toolTip
write setToolTip
notify changed
QAction::visible

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

PropertiesClass Methods
read isVisible
write setVisible
notify changed
QAction::whatsThis

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.

PropertiesClass Methods
read whatsThis
write setWhatsThis
notify changed