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: 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: QObject, path: str, iconSize: int = 30) Constructor for creating a model for SVG files in a specific path.

Parameters
QgsSvgSelectorListModel.beginInsertColumns(self, QModelIndex, int, int)
QgsSvgSelectorListModel.beginInsertRows(self, QModelIndex, int, int)
QgsSvgSelectorListModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsSvgSelectorListModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsSvgSelectorListModel.beginRemoveColumns(self, QModelIndex, int, int)
QgsSvgSelectorListModel.beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
QgsSvgSelectorListModel.changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
QgsSvgSelectorListModel.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

QgsSvgSelectorListModel.decodeData(self, int, int, QModelIndex, QDataStream) -> bool
disconnectNotify(self, QMetaMethod)
encodeData(self, Iterable[QModelIndex], QDataStream)
endInsertColumns(self)
endInsertRows(self)
endMoveColumns(self)
endMoveRows(self)
endRemoveColumns(self)
endRemoveRows(self)
endResetModel(self)
isSignalConnected(self, QMetaMethod)bool
persistentIndexList(self)List[QModelIndex]
receivers(self, PYQT_SIGNAL)int
resetInternalData(self)
rowCount(self, parent: QModelIndex = QModelIndex())int
Parameters

parent (QModelIndex = QModelIndex()) –

Return type

int

sender(self)QObject
senderSignalIndex(self)int
timerEvent(self, QTimerEvent)