Class: QgsDataCollectionItem

class qgis.core.QgsDataCollectionItem

Bases: QgsDataItem

A Collection: logical collection of layers or subcollections, e.g. GRASS location/mapset, database? wms source?

QgsDataCollectionItem(parent: QgsDataItem, name: str, path: str = ‘’, providerKey: str = ‘’) Constructor for QgsDataCollectionItem, with the specified parent item.

The name argument specifies the text to show in the model for the item. A translated string should be used wherever appropriate.

The path argument gives the item path in the browser tree. The path string can take any form, but QgsDataCollectionItem items pointing to different logical locations should always use a different item path.

The optional providerKey string can be used to specify the key for the QgsDataItemProvider that created this item.

Methods

addChild

param item

childEvent

connectNotify

customEvent

databaseConnection

rtype

QgsAbstractDatabaseProviderConnection

disconnectNotify

homeDirIcon

Shared home directory icon.

iconDataCollection

Returns the standard browser data collection icon.

iconDir

Returns the standard browser directory icon.

isSignalConnected

openDirIcon

Shared open directory icon.

receivers

sender

senderSignalIndex

timerEvent

updateIcon

Will request a repaint of this icon.

addChild(self, item: QgsDataItem)
Parameters

item (QgsDataItem) –

childEvent(self, QChildEvent)
connectNotify(self, QMetaMethod)
customEvent(self, QEvent)
databaseConnection(self) QgsAbstractDatabaseProviderConnection
Return type

QgsAbstractDatabaseProviderConnection

disconnectNotify(self, QMetaMethod)
homeDirIcon(fillColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor(), strokeColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor()) QIcon

Shared home directory icon.

Since QGIS 3.20 the optional fillColor and strokeColor arguments can be used to specify a fill and stroke color for the icon.

New in version 3.4.

Parameters
  • fillColor (Union[QColor) –

  • strokeColor (Union[QColor) –

Return type

QIcon

iconDataCollection() QIcon

Returns the standard browser data collection icon.

See also

iconDir()

Return type

QIcon

iconDir(fillColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor(), strokeColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor()) QIcon

Returns the standard browser directory icon.

Since QGIS 3.20 the optional fillColor and strokeColor arguments can be used to specify a fill and stroke color for the icon.

Parameters
  • fillColor (Union[QColor) –

  • strokeColor (Union[QColor) –

Return type

QIcon

isSignalConnected(self, QMetaMethod) bool
openDirIcon(fillColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor(), strokeColor: Union[QColor, Qt.GlobalColor, QGradient] = QColor()) QIcon

Shared open directory icon.

Since QGIS 3.20 the optional fillColor and strokeColor arguments can be used to specify a fill and stroke color for the icon.

New in version 3.4.

Parameters
  • fillColor (Union[QColor) –

  • strokeColor (Union[QColor) –

Return type

QIcon

receivers(self, PYQT_SIGNAL) int
sender(self) QObject
senderSignalIndex(self) int
timerEvent(self, QTimerEvent)
updateIcon(self)

Will request a repaint of this icon.

New in version 3.0.