PySide6.QtGui.QActionGroup¶
- class QActionGroup¶
- The - QActionGroupclass groups actions together. More…- Synopsis¶- Properties¶- enabledᅟ- Whether the action group is enabled
- exclusionPolicyᅟ- This property holds the group exclusive checking policy
- visibleᅟ- Whether the action group is visible
 - Methods¶- def - __init__()
- def - actions()
- def - addAction()
- def - checkedAction()
- def - isEnabled()
- def - isExclusive()
- def - isVisible()
- def - removeAction()
 - Slots¶- def - setDisabled()
- def - setEnabled()
- def - setExclusive()
- def - setVisible()
 - Signals¶- def - hovered()
- def - triggered()
 - Note - This documentation may contain snippets that were automatically translated from C++ to Python. We always welcome contributions to the snippet translation. If you see an issue with the translation, you can also let us know by creating a ticket on https:/bugreports.qt.io/projects/PYSIDE - Detailed Description¶- QActionGroupis a base class for classes grouping classes inhheriting- QActionobjects together.- In some situations it is useful to group - QActionobjects together. For example, if you have a Left Align action, a Right Align action, a Justify action, and a Center action, only one of these actions should be active at any one time. One simple way of achieving this is to group the actions together in an action group, inheriting- QActionGroup.- See also - class ExclusionPolicy¶
- This enum specifies the different policies that can be used to control how the group performs exclusive checking on checkable actions. - Constant - Description - QActionGroup.ExclusionPolicy.None_ - The actions in the group can be checked independently of each other. - QActionGroup.ExclusionPolicy.Exclusive - Exactly one action can be checked at any one time. This is the default policy. - QActionGroup.ExclusionPolicy.ExclusiveOptional - At most one action can be checked at any one time. The actions can also be all unchecked. - See also 
 - Note - Properties can be used directly when - from __feature__ import true_propertyis used or via accessor functions otherwise.- property enabledᅟ: bool¶
 - This property holds whether the action group is enabled. - Each action in the group will be enabled or disabled unless it has been explicitly disabled. - See also - Access functions:
 - property exclusionPolicyᅟ: QActionGroup.ExclusionPolicy¶
 - This property holds This property holds the group exclusive checking policy. - If exclusionPolicy is set to Exclusive, only one checkable action in the action group can ever be active at any time. If the user chooses another checkable action in the group, the one they chose becomes active and the one that was active becomes inactive. If exclusionPolicy is set to ExclusionOptional the group is exclusive but the active checkable action in the group can be unchecked leaving the group with no actions checked. - See also - checkable- Access functions:
 - property visibleᅟ: bool¶
 - This property holds whether the action group is visible. - Each action in the action group will match the visible state of this group unless it has been explicitly hidden. - See also - Access functions:
 - Constructs an action group for the - parentobject.- The action group is exclusive by default. Call - setExclusive(false) to make the action group non-exclusive. To make the group exclusive but allow unchecking the active action call instead- setExclusionPolicy(- ExclusiveOptional)- Returns the list of this groups’s actions. This may be empty. - Adds the - actionto this group, and returns it.- Normally an action is added to a group by creating it with the group as its parent, so this function is not usually used. - See also - addAction(text)
- Parameters:
- text – str 
- Return type:
 
 - Creates and returns an action with - text. The newly created action is a child of this action group.- Normally an action is added to a group by creating it with the group as parent, so this function is not usually used. - See also - Creates and returns an action with - textand an- icon. The newly created action is a child of this action group.- Normally an action is added to a group by creating it with the group as its parent, so this function is not usually used. - See also - Returns the currently checked action in the group, or - Noneif none are checked.- exclusionPolicy()¶
- Return type:
 - See also 
 - Getter of property - exclusionPolicyᅟ.- This signal is emitted when the given - actionin the action group is highlighted by the user; for example, when the user pauses with the cursor over a menu option or a toolbar button, or presses an action’s shortcut key combination.- See also - isEnabled()¶
- Return type:
- bool 
 
 - Getter of property - enabledᅟ.- isExclusive()¶
- Return type:
- bool 
 
 - Returns true if the group is exclusive - The group is exclusive if the - ExclusionPolicyis either Exclusive or ExclusionOptional.- isVisible()¶
- Return type:
- bool 
 
 - Getter of property - visibleᅟ.- Removes the - actionfrom this group. The action will have no parent as a result.- See also - setDisabled(b)¶
- Parameters:
- b – bool 
 
 - This is a convenience function for the - enabledproperty, that is useful for signals–slots connections. If- bis true the action group is disabled; otherwise it is enabled.- setEnabled(arg__1)¶
- Parameters:
- arg__1 – bool 
 - See also 
 - Setter of property - enabledᅟ.- setExclusionPolicy(policy)¶
- Parameters:
- policy – - ExclusionPolicy
 - See also 
 - Setter of property - exclusionPolicyᅟ.- setExclusive(b)¶
- Parameters:
- b – bool 
 
 - Enable or disable the group exclusion checking - This is a convenience method that calls - setExclusionPolicy(- Exclusive) when- bis true, else- setExclusionPolicy(- None).- See also - setVisible(arg__1)¶
- Parameters:
- arg__1 – bool 
 - See also 
 - Setter of property - visibleᅟ.- This signal is emitted when the given - actionin the action group is activated by the user; for example, when the user clicks a menu option or a toolbar button, or presses an action’s shortcut key combination.- Connect to this signal for command actions. - See also