Class: QgsColorWidgetAction¶
- class qgis.gui.QgsColorWidgetAction¶
Bases:
PyQt5.QtWidgets.QWidgetAction
An action containing a color widget, which can be embedded into a menu.
See also
New in version 2.14.
QgsColorWidgetAction(colorWidget:
QgsColorWidget
, menu: QMenu = None, parent: QWidget = None) Construct a new color widget action.- Parameters
colorWidget –
QgsColorWidget
to show in actionmenu – parent menu
parent –
parent widget
Methods
Returns the color widget contained in the widget action.
Returns whether the parent menu will be dismissed after a color is selected from the action's color widget.
Sets whether the parent menu should be dismissed and closed when a color is selected from the action's color widget.
Signals
Emitted when a color has been selected from the widget
- childEvent(self, QChildEvent)¶
- colorChanged¶
Emitted when a color has been selected from the widget
- Parameters
color (Union[QColor) – selected color [signal]
- colorWidget(self) QgsColorWidget ¶
Returns the color widget contained in the widget action.
- Return type
- connectNotify(self, QMetaMethod)¶
- createWidget(self, QWidget) QWidget ¶
- createdWidgets(self) List[QWidget] ¶
- customEvent(self, QEvent)¶
- deleteWidget(self, QWidget)¶
- disconnectNotify(self, QMetaMethod)¶
- dismissOnColorSelection(self) bool ¶
Returns whether the parent menu will be dismissed after a color is selected from the action’s color widget.
See also
- Return type
bool
- event(self, QEvent) bool ¶
- eventFilter(self, QObject, QEvent) bool ¶
- isSignalConnected(self, QMetaMethod) bool ¶
- receivers(self, PYQT_SIGNAL) int ¶
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- setDismissOnColorSelection(self, dismiss: bool)¶
Sets whether the parent menu should be dismissed and closed when a color is selected from the action’s color widget.
- Parameters
dismiss (bool) – set to
True
(default) to immediately close the menu when a color is selected from the widget. If set toFalse
, the colorChanged signal will be emitted but the menu will stay open.
See also
- timerEvent(self, QTimerEvent)¶