Class: QgsSvgSelectorListModel

class qgis.gui.QgsSvgSelectorListModel

Bases: PyQt5.QtCore.QAbstractListModel

A model for displaying SVG files with a preview icon. Population of the model is performed in a background thread to ensure that initial creation of the model is responsive and does not block the GUI.

QgsSvgSelectorListModel(parent: Optional[QObject], iconSize: int = 30) Constructor for QgsSvgSelectorListModel. All SVGs in folders from the application SVG search paths will be shown.

Parameters:
  • parent – parent object

  • iconSize – desired size of SVG icons to create

QgsSvgSelectorListModel(parent: Optional[QObject], path: Optional[str], iconSize: int = 30) Constructor for creating a model for SVG files in a specific path.

Parameters:
beginInsertColumns(self, parent: QModelIndex, first: int, last: int)
beginInsertRows(self, parent: QModelIndex, first: int, last: int)
beginMoveColumns(self, sourceParent: QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: QModelIndex, destinationColumn: int) bool
beginMoveRows(self, sourceParent: QModelIndex, sourceFirst: int, sourceLast: int, destinationParent: QModelIndex, destinationRow: int) bool
beginRemoveColumns(self, parent: QModelIndex, first: int, last: int)
beginRemoveRows(self, parent: QModelIndex, first: int, last: int)
beginResetModel(self)
changePersistentIndex(self, from_: QModelIndex, to: QModelIndex)
changePersistentIndexList(self, from_: Iterable[QModelIndex], to: Iterable[QModelIndex])
childEvent(self, a0: QChildEvent | None)
connectNotify(self, signal: QMetaMethod)
createIndex(self, row: int, column: int, object: Any = None) QModelIndex
customEvent(self, a0: QEvent | None)
data(self, index: QModelIndex, role: int = Qt.DisplayRole) Any
Parameters:
  • index (QModelIndex)

  • role (int = Qt.DisplayRole)

Return type:

Any

decodeData(self, row: int, column: int, parent: QModelIndex, stream: QDataStream) bool
disconnectNotify(self, signal: QMetaMethod)
encodeData(self, indexes: Iterable[QModelIndex], stream: QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
isSignalConnected(self, signal: QMetaMethod) bool
persistentIndexList(self) List[QModelIndex]
receivers(self, signal: PYQT_SIGNAL) int
resetInternalData(self)
rowCount(self, parent: QModelIndex = QModelIndex()) int
Parameters:

parent (QModelIndex = QModelIndex())

Return type:

int

sender(self) QObject | None
senderSignalIndex(self) int
timerEvent(self, a0: QTimerEvent | None)