Class: QgsRuleBasedRendererModel

class qgis.gui.QgsRuleBasedRendererModel(renderer: QgsRuleBasedRenderer, parent: QObject)

Bases: PyQt5.QtCore.QAbstractItemModel

Constructor for QgsRuleBasedRendererModel, for the specified renderer.

Tree model for the rules:

(invalid) == root node +— top level rule +— top level rule

Parameters
beginInsertColumns()
beginInsertRows()
beginMoveColumns()
beginMoveRows()
beginRemoveColumns()
beginRemoveRows()
beginResetModel()
changePersistentIndex()
changePersistentIndexList()
childEvent()
clearFeatureCounts(self)
columnCount(self, QModelIndex = QModelIndex()) → int
Return type

int

connectNotify()
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()
finishedAddingRules(self)
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

insertRule(self, parent: QModelIndex, before: int, newrule: QgsRuleBasedRenderer.Rule)
Parameters
isSignalConnected()
mimeData(self, indexes: Iterable[QModelIndex]) → QMimeData
Parameters

indexes (Iterable[QModelIndex]) –

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

removeRule(self, index: QModelIndex)
Parameters

index (QModelIndex) –

resetInternalData()
rowCount(self, parent: QModelIndex = QModelIndex()) → int
Parameters

parent (QModelIndex = QModelIndex()) –

Return type

int

ruleForIndex(self, index: QModelIndex) → QgsRuleBasedRenderer.Rule
Parameters

index (QModelIndex) –

Return type

QgsRuleBasedRenderer.Rule

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

setSymbol(self, index: QModelIndex, symbol: QgsSymbol)

Sets the symbol for the rule at the specified index. Ownership of the symbols is transferred to the renderer.

New in version 3.10.

Parameters
  • index (QModelIndex) –

  • symbol (QgsSymbol) –

supportedDropActions(self) → Qt.DropActions
Return type

Qt.DropActions

timerEvent()
updateRule(self, parent: QModelIndex, row: int)

updateRule(self, index: QModelIndex)

Parameters
  • parent (QModelIndex) –

  • row (int) –

willAddRules(self, parent: QModelIndex, count: int)
Parameters
  • parent (QModelIndex) –

  • count (int) –