Class: QgsToolButtonAction¶
QWidgetAction for adding toolbuttons/actions to the toolbars which are not children of QMainWindow.
QgsToolButtonAction should be used to add buttons with
dropdown menus to make them available in the toolbar extension popup.
Added in version 4.4.
List of all members, including inherited members
Class Hierarchy¶
Base classes¶
Constructor
Methods
Appends actions to the button's list of actions. |
|
Returns the default action. |
|
Sets whether auto-raise is enabled. |
|
Sets the default action to action |
|
Associates a menu with this tool button. |
|
Sets the popup mode to use for button's popup menu. |
|
Sets the toolbutton style, e.g. icon only, text only, or text beside/below the icon. |
- class qgis.gui.QgsToolButtonAction[source]¶
Bases:
QWidgetAction- __init__(parent: QObject | None = None)¶
Constructor for QgsToolButtonAction
- Parameters:
parent (QObject|None = None) – parent widget
- addActions(self, actions: Iterable[QAction])[source]¶
Appends
actionsto the button’s list of actions. This is an alternative tosetMenu(), the buttons build their popup menu from these actions. If a menu was set withsetMenu()it takes precedence.See also
- Parameters:
actions (Iterable[QAction])
- defaultAction(self) QAction | None[source]¶
Returns the default action.
See also
- Return type:
QAction|None
- setAutoRaise(self, autoRaise: bool)[source]¶
Sets whether auto-raise is enabled.
- Parameters:
autoRaise (bool)
- setDefaultAction(self, action: QAction | None)[source]¶
Sets the default action to
actionThe buttons mirror the default action’s icon, text, tooltip and state, and clicking a button triggers it.
Ownership of the action is not transferred.
See also
- Parameters:
action (QAction|None)
- setMenu(self, menu: QMenu | None)[source]¶
Associates a
menuwith this tool button. The menu will be shown according to the button’s popup mode. Ownership of the menu is not transferred.See also
See also
- Parameters:
menu (QMenu|None)