Subgroup: Color
Class: QgsColorSwatchGrid¶
-
class
qgis.gui.
QgsColorSwatchGrid
¶ Bases:
PyQt5.QtWidgets.QWidget
A grid of color swatches, which allows for user selection. Colors are taken from an associated QgsColorScheme.
See also
QgsColorGridAction
New in version 2.5: Methods
acceptDrops
accessibleDescription
accessibleName
actionEvent
actions
activateWindow
addAction
addActions
adjustSize
autoFillBackground
backgroundRole
baseColor
Get the base color for the widget baseSize
blockSignals
changeEvent
childAt
childAt(self, int, int) -> QWidget childEvent
children
childrenRect
childrenRegion
clearFocus
clearMask
close
closeEvent
colorCount
colors
Gets the list of colors shown in the grid connectNotify
contentsMargins
contentsRect
context
Get the current context for the grid contextMenuEvent
contextMenuPolicy
create
createWindowContainer
cursor
customEvent
deleteLater
depth
destroy
devType
devicePixelRatio
devicePixelRatioF
devicePixelRatioFScale
disconnect
disconnectNotify
dragEnterEvent
dragLeaveEvent
dragMoveEvent
dropEvent
dumpObjectInfo
dumpObjectTree
dynamicPropertyNames
effectiveWinId
ensurePolished
enterEvent
event
eventFilter
find
findChild
findChild(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> QObject findChildren
findChildren(self, Tuple, name: str = ‘’, options: Union[Qt.FindChildOptions, Qt.FindChildOption] = Qt.FindChildrenRecursively) -> List[QObject] focusInEvent
focusNextChild
focusNextPrevChild
focusOutEvent
focusPolicy
focusPreviousChild
focusProxy
focusWidget
font
fontInfo
fontMetrics
foregroundRole
frameGeometry
frameSize
geometry
getContentsMargins
grab
grabGesture
grabKeyboard
grabMouse
grabMouse(self, Union[QCursor, Qt.CursorShape]) grabShortcut
graphicsEffect
graphicsProxyWidget
hasFocus
hasHeightForWidth
hasMouseTracking
hasTabletTracking
height
heightForWidth
heightMM
hide
hideEvent
inherits
initPainter
inputMethodEvent
inputMethodHints
inputMethodQuery
insertAction
insertActions
installEventFilter
isActiveWindow
isAncestorOf
isEnabled
isEnabledTo
isFullScreen
isHidden
isLeftToRight
isMaximized
isMinimized
isModal
isRightToLeft
isSignalConnected
isVisible
isVisibleTo
isWidgetType
isWindow
isWindowModified
isWindowType
keyPressEvent
keyReleaseEvent
keyboardGrabber
killTimer
layout
layoutDirection
leaveEvent
locale
logicalDpiX
logicalDpiY
lower
mapFrom
mapFromGlobal
mapFromParent
mapTo
mapToGlobal
mapToParent
mask
maximumHeight
maximumSize
maximumWidth
metaObject
metric
minimumHeight
minimumSize
minimumSizeHint
minimumWidth
mouseDoubleClickEvent
mouseGrabber
mouseMoveEvent
mousePressEvent
mouseReleaseEvent
move
move(self, int, int) moveEvent
moveToThread
nativeEvent
nativeParentWidget
nextInFocusChain
normalGeometry
objectName
overrideWindowFlags
overrideWindowState
paintEngine
paintEvent
paintingActive
palette
parent
parentWidget
physicalDpiX
physicalDpiY
pos
previousInFocusChain
property
pyqtConfigure
Each keyword argument is either the name of a Qt property or a Qt signal. raise_
receivers
rect
refreshColors
Reload colors from scheme and redraws the widget releaseKeyboard
releaseMouse
releaseShortcut
removeAction
removeEventFilter
render
render(self, QPainter, targetOffset: QPoint = QPoint(), sourceRegion: QRegion = QRegion(), flags: Union[QWidget.RenderFlags, QWidget.RenderFlag] = QWidget.RenderFlags(QWidget.DrawWindowBackground|QWidget.DrawChildren)) repaint
repaint(self, int, int, int, int) resize
resize(self, int, int) resizeEvent
restoreGeometry
saveGeometry
scroll
scroll(self, int, int, QRect) sender
senderSignalIndex
setAcceptDrops
setAccessibleDescription
setAccessibleName
setAttribute
setAutoFillBackground
setBackgroundRole
setBaseColor
Sets the base color for the widget setBaseSize
setBaseSize(self, QSize) setContentsMargins
setContentsMargins(self, QMargins) setContext
Sets the current context for the grid setContextMenuPolicy
setCursor
setDisabled
setEnabled
setFixedHeight
setFixedSize
setFixedSize(self, int, int) setFixedWidth
setFocus
setFocus(self, Qt.FocusReason) setFocusPolicy
setFocusProxy
setFont
setForegroundRole
setGeometry
setGeometry(self, int, int, int, int) setGraphicsEffect
setHidden
setInputMethodHints
setLayout
setLayoutDirection
setLocale
setMask
setMask(self, QRegion) setMaximumHeight
setMaximumSize
setMaximumSize(self, QSize) setMaximumWidth
setMinimumHeight
setMinimumSize
setMinimumSize(self, QSize) setMinimumWidth
setMouseTracking
setObjectName
setPalette
setParent
setParent(self, QWidget, Union[Qt.WindowFlags, Qt.WindowType]) setProperty
setShortcutAutoRepeat
setShortcutEnabled
setSizeIncrement
setSizeIncrement(self, QSize) setSizePolicy
setSizePolicy(self, QSizePolicy.Policy, QSizePolicy.Policy) setStatusTip
setStyle
setStyleSheet
setTabOrder
setTabletTracking
setToolTip
setToolTipDuration
setUpdatesEnabled
setVisible
setWhatsThis
setWindowFilePath
setWindowFlag
setWindowFlags
setWindowIcon
setWindowIconText
setWindowModality
setWindowModified
setWindowOpacity
setWindowRole
setWindowState
setWindowTitle
sharedPainter
show
showEvent
showFullScreen
showMaximized
showMinimized
showNormal
signalsBlocked
size
sizeHint
sizeIncrement
sizePolicy
stackUnder
startTimer
statusTip
style
styleSheet
tabletEvent
testAttribute
thread
timerEvent
toolTip
toolTipDuration
tr
underMouse
ungrabGesture
unsetCursor
unsetLayoutDirection
unsetLocale
update
update(self, QRect) updateGeometry
updateMicroFocus
updatesEnabled
visibleRegion
whatsThis
wheelEvent
width
widthMM
winId
window
windowFilePath
windowFlags
windowHandle
windowIcon
windowIconText
windowModality
windowOpacity
windowRole
windowState
windowTitle
windowType
x
y
Attributes
DrawChildren
DrawWindowBackground
IgnoreMask
PdmDepth
PdmDevicePixelRatio
PdmDevicePixelRatioScaled
PdmDpiX
PdmDpiY
PdmHeight
PdmHeightMM
PdmNumColors
PdmPhysicalDpiX
PdmPhysicalDpiY
PdmWidth
PdmWidthMM
colorChanged
Emitted when a color has been selected from the widget customContextMenuRequested
customContextMenuRequested(self, QPoint) [signal] destroyed
destroyed(self, QObject = None) [signal] hovered
Emitted when mouse hovers over widget [signal] objectNameChanged
objectNameChanged(self, str) [signal] staticMetaObject
windowIconChanged
windowIconChanged(self, QIcon) [signal] windowIconTextChanged
windowIconTextChanged(self, str) [signal] windowTitleChanged
windowTitleChanged(self, str) [signal] -
actionEvent
()¶
-
baseColor
(self) → QColor¶ Get the base color for the widget
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
Returns: list of colors currently shown in the grid
-
connectNotify
()¶
-
context
(self) → str¶ Get the current context for the grid
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)¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
(self, event: QFocusEvent)¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
hovered
¶ Emitted when mouse hovers over widget [signal]
-
initPainter
()¶
-
inputMethodEvent
()¶
-
isSignalConnected
()¶
-
keyPressEvent
(self, event: QKeyEvent)¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
minimumSizeHint
(self) → QSize¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
(self, event: QMouseEvent)¶
-
mousePressEvent
(self, event: QMouseEvent)¶
-
mouseReleaseEvent
(self, event: QMouseEvent)¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
(self, 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 – base color to pass to scheme for color generation See also
-
setContext
(self, context: str)¶ Sets the current context for the grid
Parameters: context – string which is passed to scheme for color generation See also
-
showEvent
()¶
-
sizeHint
(self) → QSize¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateMicroFocus
()¶
-
wheelEvent
()¶
-