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

Methods

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

changePersistentIndex

changePersistentIndexList

childEvent

clearFeatureCounts

columnCount

rtype

int

connectNotify

createIndex

customEvent

data

param index

decodeData

disconnectNotify

dropMimeData

param data

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

finishedAddingRules

flags

param index

headerData

param section

index

param row

insertRule

param parent

isSignalConnected

mimeData

param indexes

mimeTypes

rtype

List[str]

parent

param index

persistentIndexList

receivers

removeRows

param row

removeRule

param index

resetInternalData

rowCount

param parent

ruleForIndex

param index

sender

senderSignalIndex

setData

param index

setSymbol

Sets the symbol for the rule at the specified index.

supportedDropActions

rtype

Qt.DropActions

timerEvent

updateRule

updateRule(self, index: QModelIndex)

willAddRules

param parent

QgsRuleBasedRendererModel.beginInsertColumns(self, QModelIndex, int, int)
QgsRuleBasedRendererModel.beginInsertRows(self, QModelIndex, int, int)
QgsRuleBasedRendererModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsRuleBasedRendererModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsRuleBasedRendererModel.beginRemoveColumns(self, QModelIndex, int, int)
QgsRuleBasedRendererModel.beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
QgsRuleBasedRendererModel.changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
clearFeatureCounts(self)
columnCount(self, QModelIndex=QModelIndex())int
Return type

int

connectNotify(self, QMetaMethod)
QgsRuleBasedRendererModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
customEvent(self, QEvent)
data(self, index: QModelIndex, role: int = Qt.DisplayRole)Any
Parameters
  • index (QModelIndex) –

  • role (int = Qt.DisplayRole) –

Return type

Any

QgsRuleBasedRendererModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
disconnectNotify(self, QMetaMethod)
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(self, Iterable[QModelIndex], QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
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(self, QMetaMethod)bool
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(self)List[QModelIndex]
receivers(self, PYQT_SIGNAL)int
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(self)
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(self)QObject
senderSignalIndex(self)int
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(self, QTimerEvent)
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) –