Class: QgsColorSchemeModel¶
-
class
qgis.gui.
QgsColorSchemeModel
(scheme: QgsColorScheme, context: str = '', baseColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor(), parent: QObject = None)¶ Bases:
PyQt5.QtCore.QAbstractItemModel
Constructor
- Parameters
scheme (QgsColorScheme) – color scheme for list
context (str = '') – context string for color scheme
baseColor (Union[QColor) – base color for color scheme
parent (QObject = None) – parent object
A model for colors in a color scheme
See also
Methods
Add a color to the list
Gets the base color for the color scheme used by the model
Returns a list of colors shown in the widget
- param parent
Gets the current color scheme context for the model
- param index
- param data
- param index
- param section
- param row
- param row
Returns whether the color scheme model has been modified
- param indexes
- rtype
List[str]
- param index
- param row
- param parent
- param index
Sets the color scheme to show in the widget
- rtype
Qt.DropActions
-
addColor
(self, color: Union[QColor, Qt.GlobalColor, QGradient], label: str = '', allowDuplicate: bool = False)¶ Add a color to the list
- Parameters
color (Union[QColor) – color to add
label (str = '') – label for color
allowDuplicate (bool = False) – set to true to allow duplicate colors to be added (colors which are already present in the list)
-
baseColor
(self) → QColor¶ Gets the base color for the color scheme used by the model
- Return type
QColor
- Returns
base color which is passed to scheme for color generation
See also
-
beginInsertColumns
()¶
-
beginInsertRows
()¶
-
beginMoveColumns
()¶
-
beginMoveRows
()¶
-
beginRemoveColumns
()¶
-
beginRemoveRows
()¶
-
beginResetModel
()¶
-
changePersistentIndex
()¶
-
changePersistentIndexList
()¶
-
childEvent
()¶
-
colors
(self) → object¶ Returns a list of colors shown in the widget
- Return type
object
- Returns
colors shown in the widget
-
columnCount
(self, parent: QModelIndex = QModelIndex()) → int¶ - Parameters
parent (QModelIndex = QModelIndex()) –
- Return type
int
-
connectNotify
()¶
-
context
(self) → str¶ Gets the current color scheme context for the model
- Return type
str
- Returns
context string which is passed to scheme for color generation
See also
-
createIndex
()¶
-
customEvent
()¶
-
data
(self, index: QModelIndex, role: int = Qt.DisplayRole) → Any¶ - Parameters
index (QModelIndex) –
role (int = Qt.DisplayRole) –
- Return type
Any
-
decodeData
()¶
-
disconnectNotify
()¶
-
dropMimeData
(self, data: QMimeData, action: Qt.DropAction, row: int, column: int, parent: QModelIndex) → bool¶ - Parameters
data (QMimeData) –
action (Qt.DropAction) –
row (int) –
column (int) –
parent (QModelIndex) –
- Return type
bool
-
encodeData
()¶
-
endInsertColumns
()¶
-
endInsertRows
()¶
-
endMoveColumns
()¶
-
endMoveRows
()¶
-
endRemoveColumns
()¶
-
endRemoveRows
()¶
-
endResetModel
()¶
-
flags
(self, index: QModelIndex) → Qt.ItemFlags¶ - Parameters
index (QModelIndex) –
- Return type
Qt.ItemFlags
-
headerData
(self, section: int, orientation: Qt.Orientation, role: int = Qt.DisplayRole) → Any¶ - Parameters
section (int) –
orientation (Qt.Orientation) –
role (int = Qt.DisplayRole) –
- Return type
Any
-
index
(self, row: int, column: int, parent: QModelIndex = QModelIndex()) → QModelIndex¶ - Parameters
row (int) –
column (int) –
parent (QModelIndex = QModelIndex()) –
- Return type
QModelIndex
-
insertRows
(self, row: int, count: int, parent: QModelIndex = QModelIndex()) → bool¶ - Parameters
row (int) –
count (int) –
parent (QModelIndex = QModelIndex()) –
- Return type
bool
-
isDirty
(self) → bool¶ Returns whether the color scheme model has been modified
- Return type
bool
- Returns
true if colors have been modified
-
isSignalConnected
()¶
-
mimeData
(self, indexes: object) → QMimeData¶ - Parameters
indexes (object) –
- Return type
QMimeData
-
mimeTypes
(self) → List[str]¶ - Return type
List[str]
-
parent
(self, index: QModelIndex) → QModelIndex¶ - Parameters
index (QModelIndex) –
- Return type
QModelIndex
-
persistentIndexList
()¶
-
receivers
()¶
-
removeRows
(self, row: int, count: int, parent: QModelIndex = QModelIndex()) → bool¶ - Parameters
row (int) –
count (int) –
parent (QModelIndex = QModelIndex()) –
- Return type
bool
-
resetInternalData
()¶
-
rowCount
(self, parent: QModelIndex = QModelIndex()) → int¶ - Parameters
parent (QModelIndex = QModelIndex()) –
- Return type
int
-
sender
()¶
-
senderSignalIndex
()¶
-
setData
(self, index: QModelIndex, value: Any, role: int = Qt.EditRole) → bool¶ - Parameters
index (QModelIndex) –
value (Any) –
role (int = Qt.EditRole) –
- Return type
bool
-
setScheme
(self, scheme: QgsColorScheme, context: str = '', baseColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor())¶ Sets the color scheme to show in the widget
- Parameters
scheme (QgsColorScheme) – color scheme
context (str = '') – context for color scheme
baseColor (Union[QColor) – base color for color scheme
-
supportedDropActions
(self) → Qt.DropActions¶ - Return type
Qt.DropActions
-
timerEvent
()¶