Class: QgsColorSchemeList¶
-
class
qgis.gui.
QgsColorSchemeList
(parent: QWidget = None, scheme: QgsColorScheme = None, context: str = '', baseColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor())¶ Bases:
PyQt5.QtWidgets.QTreeView
Construct a new color swatch grid.
- Parameters
parent – parent widget
scheme – QgsColorScheme for colors to show in the list
context – context string provided to color scheme
baseColor – base color for color scheme
An editable list of color swatches, taken from an associated
QgsColorScheme
.See also
New in version 2.5: Enums
Methods
Adds a color to the list
Copies colors from the list to the clipboard
Export colors to a GPL palette file from the list
Import colors from a GPL palette file to the list
Returns whether the color scheme list has been modified
Pastes colors from clipboard to the list
Removes any selected colors from the list
Saves the current colors shown in the list back to a color scheme, if supported by the color scheme.
Returns the scheme currently selected in the list.
Sets the color scheme to show in the list
Displays a file picker dialog allowing users to export colors from the list into a file.
Displays a file picker dialog allowing users to import colors into the list from a file.
Signals
Emitted when a color is selected from the list
Attributes
-
actionEvent
()¶
-
addColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient], label: str = '', allowDuplicate: bool = False)¶ Adds a color to the list
- Parameters
color – color to add
label – optional label for color
allowDuplicate – set to true to allow duplicate colors to be added, ie colors which already exist in the list
-
changeEvent
()¶
-
childEvent
()¶
-
closeEditor
()¶
-
closeEvent
()¶
-
colorSelected
¶ Emitted when a color is selected from the list
- Parameters
color – color selected [signal]
-
columnCountChanged
()¶
-
columnMoved
()¶
-
columnResized
()¶
-
commitData
()¶
-
connectNotify
()¶
-
contextMenuEvent
()¶
-
copyColors
(self)¶ Copies colors from the list to the clipboard
See also
-
create
()¶
-
currentChanged
()¶
-
customEvent
()¶
-
destroy
()¶
-
dirtyRegionOffset
()¶
-
disconnectNotify
()¶
-
dragEnterEvent
()¶
-
dragLeaveEvent
()¶
-
dragMoveEvent
()¶
-
drawBranches
()¶
-
drawFrame
()¶
-
drawRow
()¶
-
drawTree
()¶
-
dropEvent
()¶
-
dropIndicatorPosition
()¶
-
edit
()¶
-
editorDestroyed
()¶
-
enterEvent
()¶
-
event
()¶
-
eventFilter
()¶
-
executeDelayedItemsLayout
()¶
-
exportColorsToGpl
(self, file: QFile) → bool¶ Export colors to a GPL palette file from the list
- Parameters
file – destination file
See also
-
focusInEvent
()¶
-
focusNextChild
()¶
-
focusNextPrevChild
()¶
-
focusOutEvent
()¶
-
focusPreviousChild
()¶
-
hideEvent
()¶
-
horizontalOffset
()¶
-
horizontalScrollbarAction
()¶
-
horizontalScrollbarValueChanged
()¶
-
importColorsFromGpl
(self, file: QFile) → bool¶ Import colors from a GPL palette file to the list
- Parameters
file – file to import
See also
-
indexRowSizeHint
()¶
-
initPainter
()¶
-
initStyleOption
()¶
-
inputMethodEvent
()¶
-
isDirty
(self) → bool¶ Returns whether the color scheme list has been modified
- Returns
true if colors have been modified
-
isIndexHidden
()¶
-
isSignalConnected
()¶
-
keyPressEvent
(self, event: QKeyEvent)¶
-
keyReleaseEvent
()¶
-
leaveEvent
()¶
-
metric
()¶
-
mouseDoubleClickEvent
()¶
-
mouseMoveEvent
()¶
-
mousePressEvent
(self, event: QMouseEvent)¶
-
mouseReleaseEvent
(self, event: QMouseEvent)¶
-
moveCursor
()¶
-
moveEvent
()¶
-
nativeEvent
()¶
-
paintEvent
()¶
-
pasteColors
(self)¶ Pastes colors from clipboard to the list
See also
-
receivers
()¶
-
reexpand
()¶
-
removeSelection
(self)¶ Removes any selected colors from the list
-
resizeEvent
()¶
-
rowHeight
()¶
-
rowsAboutToBeRemoved
()¶
-
rowsInserted
()¶
-
rowsRemoved
()¶
-
saveColorsToScheme
(self) → bool¶ Saves the current colors shown in the list back to a color scheme, if supported by the color scheme.
Note
this method is only effective if the color scheme is editable
-
scheduleDelayedItemsLayout
()¶
-
scheme
(self) → QgsColorScheme¶ Returns the scheme currently selected in the list.
See also
New in version 3.0.
-
scrollContentsBy
()¶
-
scrollDirtyRegion
()¶
-
selectedIndexes
()¶
-
selectionChanged
()¶
-
selectionCommand
()¶
-
sender
()¶
-
senderSignalIndex
()¶
-
setDirtyRegion
()¶
-
setScheme
(self, scheme: QgsColorScheme, context: str = '', baseColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor())¶ Sets the color scheme to show in the list
- Parameters
scheme – QgsColorScheme for colors to show in the list
context – context string provided to color scheme
baseColor – base color for color scheme
See also
-
setSelection
()¶
-
setState
()¶
-
setViewportMargins
()¶
-
showEvent
()¶
-
showExportColorsDialog
(self)¶ Displays a file picker dialog allowing users to export colors from the list into a file.
See also
New in version 3.0.
-
showImportColorsDialog
(self)¶ Displays a file picker dialog allowing users to import colors into the list from a file.
See also
New in version 3.0.
-
sizeHintForColumn
()¶
-
startDrag
()¶
-
state
()¶
-
tabletEvent
()¶
-
timerEvent
()¶
-
updateEditorData
()¶
-
updateEditorGeometries
()¶
-
updateGeometries
()¶
-
updateMicroFocus
()¶
-
verticalOffset
()¶
-
verticalScrollbarAction
()¶
-
verticalScrollbarValueChanged
()¶
-
viewOptions
()¶
-
viewportEvent
()¶
-
viewportMargins
()¶
-
viewportSizeHint
()¶
-
visualRegionForSelection
()¶
-
wheelEvent
()¶