QAction Class Reference |
Constant | Value | Description |
---|---|---|
QAction.Trigger | 0 | this will cause the QAction.triggered() signal to be emitted. |
QAction.Hover | 1 | this 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.
Constant | Value | Description |
---|---|---|
QAction.NoRole | 0 | This action should not be put into the application menu |
QAction.TextHeuristicRole | 1 | This action should be put in the application menu based on the action's text as described in the QMenuBar documentation. |
QAction.ApplicationSpecificRole | 2 | This action should be put in the application menu with an application specific role |
QAction.AboutQtRole | 3 | This action matches handles the "About Qt" menu item. |
QAction.AboutRole | 4 | This action should be placed where the "About" menu item is in the application menu. |
QAction.PreferencesRole | 5 | This action should be placed where the "Preferences..." menu item is in the application menu. |
QAction.QuitRole | 6 | This action should be placed where the Quit menu item is in the application menu. |
The parent argument, if not None, causes self to be owned by Qt instead of PyQt.
Constructs an action with parent. If parent is an action group the action will be automatically inserted into the group.
The parent argument, if not None, causes self to be owned by Qt instead of PyQt.
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().
The parent argument, if not None, causes self to be owned by Qt instead of PyQt.
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().
Returns the action group for this action. If no action group manages this action then 0 will be returned.
See also QActionGroup and QAction.setActionGroup().
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.
Returns a list of widgets this action has been added to.
This function was introduced in Qt 4.2.
See also QWidget.addAction().
Returns the user data as set in QAction.setData.
See also setData().
This method is also a Qt slot with the C++ signature void hover().
This is a convenience slot that calls activate(Hover).
Returns true if this action is a separator action; otherwise it returns false.
See also QAction.setSeparator().
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() and QMenu.addAction().
Returns the parent widget.
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 and QAction.actionGroup().
This method is also a Qt slot with the C++ signature void setChecked(bool).
Sets the action's internal data to the given userData.
See also data().
This method is also a Qt slot with the C++ signature void setDisabled(bool).
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.
This method is also a Qt slot with the C++ signature void setEnabled(bool).
Sets the menu contained by this action to the specified menu.
See also menu().
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().
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.
See also shortcuts() and shortcut.
This is an overloaded member function, provided for convenience.
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().
This method is also a Qt slot with the C++ signature void setVisible(bool).
Returns the list of shortcuts, with the primary shortcut as the first element of the list.
This function was introduced in Qt 4.2.
See also setShortcuts().
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.
This method is also a Qt slot with the C++ signature void toggle().
This is a convenience function for the checked property. Connect to it to change the checked state to its opposite state.
This method is also a Qt slot with the C++ signature void trigger().
This is a convenience slot that calls activate(Trigger).
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().
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().
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.
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.
PyQt 4.4.4 for Windows | Copyright © Riverbank Computing Ltd and Trolltech AS 2008 | Qt 4.4.2 |