Class: QgsColorSwatchGrid¶
-
class
qgis.gui.
QgsColorSwatchGrid
(scheme: QgsColorScheme, context: str = '', parent: QWidget = None)¶ Bases:
PyQt5.QtWidgets.QWidget
Construct a new color swatch grid.
- Parameters
scheme (QgsColorScheme) –
QgsColorScheme
for colors to show in gridcontext (str = '') – context string provided to color scheme
parent (QWidget = None) – parent widget
A grid of color swatches, which allows for user selection. Colors are taken from an associated QgsColorScheme.
See also
QgsColorGridAction
Methods
Gets the base color for the widget
Gets the list of colors shown in the grid
Gets the current context for the grid
- param event
- param event
- param event
- rtype
QSize
- param event
- param event
- param event
- param event
Reload colors from scheme and redraws the widget
Sets the base color for the widget
Sets the current context for the grid
- rtype
QSize
Signals
Emitted when a color has been selected from the widget
Emitted when mouse hovers over widget [signal]
-
actionEvent
()¶
-
baseColor
(self) → QColor¶ Gets the base color for the widget
- Return type
QColor
- Returns
base color which is passed to scheme for color generation
See also
-
changeEvent
()¶
-
childEvent
()¶
-
closeEvent
()¶
-
colorChanged
¶ Emitted when a color has been selected from the widget
- Parameters
color – selected color [signal]
-
colors
(self) → object¶ Gets the list of colors shown in the grid
- Return type
object
- Returns
list of colors currently shown in the grid
-
connectNotify
()¶
-
context
(self) → str¶ Gets the current context for the grid
- Return type
str
- Returns
context string which is passed to scheme for color generation
See also
-
contextMenuEvent
()¶
-
create
()¶
-
customEvent
()¶
-
destroy
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
dropEvent
()¶
-
enterEvent
()¶
-
event
()¶
-
focusInEvent
(self, event: QFocusEvent)¶ - Parameters
event (QFocusEvent) –
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
(self, event: QFocusEvent)¶ - Parameters
event (QFocusEvent) –
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
hovered
¶ Emitted when mouse hovers over widget [signal]
-
initPainter
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
(self, event: QKeyEvent)¶ - Parameters
event (QKeyEvent) –
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
minimumSizeHint
(self) → QSize¶ - Return type
QSize
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
(self, event: QMouseEvent)¶ - Parameters
event (QMouseEvent) –
-
mousePressEvent
(self, event: QMouseEvent)¶ - Parameters
event (QMouseEvent) –
-
mouseReleaseEvent
(self, event: QMouseEvent)¶ - Parameters
event (QMouseEvent) –
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
(self, event: QPaintEvent)¶ - Parameters
event (QPaintEvent) –
-
receivers
()¶
-
refreshColors
(self)¶ Reload colors from scheme and redraws the widget
-
resizeEvent
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setBaseColor
(self, baseColor: Union[QColor, Qt.GlobalColor, QGradient])¶ Sets the base color for the widget
- Parameters
baseColor (Union[QColor) – base color to pass to scheme for color generation
See also
-
setContext
(self, context: str)¶ Sets the current context for the grid
- Parameters
context (str) – string which is passed to scheme for color generation
See also
-
showEvent
()¶
-
sizeHint
(self) → QSize¶ - Return type
QSize
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶