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 forQgsDataCollectionItem
, with the specifiedparent
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. Thepath
string can take any form, butQgsDataCollectionItem
items pointing to different logical locations should always use a different itempath
.The optional
providerKey
string can be used to specify the key for theQgsDataItemProvider
that created this item.Methods
- param item:
- rtype:
QgsAbstractDatabaseProviderConnection
The item is scheduled to be deleted.
Shared home directory icon.
Returns the standard browser data collection icon.
Returns the standard browser directory icon.
Shared open directory icon.
Refresh the items from a specified list of child items.
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:
- deferredDelete(self) bool ¶
The item is scheduled to be deleted. E.g. if
deleteLater()
is called when item is in Populating state (createChildren()
running in another thread), thedeferredDelete()
returnsTrue
and item will be deleted once Populating finished. Items with slowreateChildren()
(for example network or database based) may check duringcreateChildren()
ifdeferredDelete()
returnsTrue
and return fromcreateChildren()
immediately because result will be useless.
- disconnectNotify(self, QMetaMethod)¶
- homeDirIcon(fillColor: QColor | Qt.GlobalColor | QGradient = QColor(), strokeColor: QColor | Qt.GlobalColor | QGradient = QColor()) QIcon ¶
Shared home directory icon.
Since QGIS 3.20 the optional
fillColor
andstrokeColor
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
- Return type:
QIcon
- iconDir(fillColor: QColor | Qt.GlobalColor | QGradient = QColor(), strokeColor: QColor | Qt.GlobalColor | QGradient = QColor()) QIcon ¶
Returns the standard browser directory icon.
Since QGIS 3.20 the optional
fillColor
andstrokeColor
arguments can be used to specify a fill and stroke color for the icon.See also
- Parameters:
fillColor (Union[QColor) –
strokeColor (Union[QColor) –
- Return type:
QIcon
- isSignalConnected(self, QMetaMethod) bool ¶
- openDirIcon(fillColor: QColor | Qt.GlobalColor | QGradient = QColor(), strokeColor: QColor | Qt.GlobalColor | QGradient = QColor()) QIcon ¶
Shared open directory icon.
Since QGIS 3.20 the optional
fillColor
andstrokeColor
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
- populate(self, children: Iterable[QgsDataItem])¶
- populate(self, foreground: bool = False) None
- receivers(self, PYQT_SIGNAL) int ¶
- refresh(self, children: Iterable[QgsDataItem])¶
Refresh the items from a specified list of child items.
refresh(self)
- sender(self) QObject ¶
- senderSignalIndex(self) int ¶
- timerEvent(self, QTimerEvent)¶
- updateIcon(self)¶
Will request a repaint of this icon.
New in version 3.0.