Class: QgsProjectStyleDatabaseModel

class qgis.core.QgsProjectStyleDatabaseModel

Bases: PyQt5.QtCore.QAbstractListModel

List model representing the style databases associated with a QgsProject.

New in version 3.26.

QgsProjectStyleDatabaseModel(settings: QgsProjectStyleSettings, parent: QObject = None) Constructor for QgsProjectStyleDatabaseModel, showing the styles from the specified settings.

Methods

beginInsertColumns

beginInsertRows

beginMoveColumns

beginMoveRows

beginRemoveColumns

beginRemoveRows

beginResetModel

changePersistentIndex

changePersistentIndexList

childEvent

connectNotify

createIndex

customEvent

data

param index

decodeData

disconnectNotify

encodeData

endInsertColumns

endInsertRows

endMoveColumns

endMoveRows

endRemoveColumns

endRemoveRows

endResetModel

indexFromStyle

Returns the model index corresponding to a style.

isSignalConnected

persistentIndexList

receivers

resetInternalData

rowCount

param parent

sender

senderSignalIndex

setShowDefaultStyle

Sets whether the default style should also be included in the model.

showDefaultStyle

Returns True if the model includes the default style.

styleFromIndex

Returns the style at the corresponding index.

timerEvent

Attributes

PathRole

StyleRole

PathRole = 258
class Role

Bases: int

StyleRole = 257
QgsProjectStyleDatabaseModel.beginInsertColumns(self, QModelIndex, int, int)
QgsProjectStyleDatabaseModel.beginInsertRows(self, QModelIndex, int, int)
QgsProjectStyleDatabaseModel.beginMoveColumns(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsProjectStyleDatabaseModel.beginMoveRows(self, QModelIndex, int, int, QModelIndex, int) -> bool
QgsProjectStyleDatabaseModel.beginRemoveColumns(self, QModelIndex, int, int)
QgsProjectStyleDatabaseModel.beginRemoveRows(self, QModelIndex, int, int)
beginResetModel(self)
QgsProjectStyleDatabaseModel.changePersistentIndex(self, QModelIndex, QModelIndex)
changePersistentIndexList(self, Iterable[QModelIndex], Iterable[QModelIndex])
childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
QgsProjectStyleDatabaseModel.createIndex(self, int, int, object: object = 0) -> QModelIndex
customEvent(self, QEvent)
data(self, index: QModelIndex, role: int) Any
Parameters
  • index (QModelIndex) –

  • role (int) –

Return type

Any

QgsProjectStyleDatabaseModel.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)
indexFromStyle(self, style: QgsStyle) QModelIndex

Returns the model index corresponding to a style.

See also

styleFromIndex()

Parameters

style (QgsStyle) –

Return type

QModelIndex

isSignalConnected(self, QMetaMethod) bool
persistentIndexList(self) List[QModelIndex]
receivers(self, PYQT_SIGNAL) int
resetInternalData(self)
rowCount(self, parent: QModelIndex) int
Parameters

parent (QModelIndex) –

Return type

int

sender(self) QObject
senderSignalIndex(self) int
setShowDefaultStyle(self, show: bool)

Sets whether the default style should also be included in the model.

Parameters

show (bool) –

showDefaultStyle(self) bool

Returns True if the model includes the default style.

Return type

bool

styleFromIndex(self, index: QModelIndex) QgsStyle

Returns the style at the corresponding index.

See also

indexFromStyle()

Parameters

index (QModelIndex) –

Return type

QgsStyle

timerEvent(self, QTimerEvent)