Class: QgsDataCollectionItem¶
A browser item for collections of data.
These represent logical collection of layers or subcollections, e.g. GRASS location/mapset, database? wms source?
Class Hierarchy¶
Base classes¶
Base class for all items in the model. |
|
Subclasses¶
A browser item that represents a root group of connections from a single data provider. |
|
A browser item that represents a database schema item. |
|
A browser item for directories: contains subdirectories and layers. |
|
A browser item which contains various Favorites directories. |
|
A browser item for zip (archive) files. |
Methods
Static Methods
Shared home directory icon. |
|
Returns the standard browser data collection icon. |
|
Returns the standard browser directory icon. |
|
Shared open directory icon. |
- class qgis.core.QgsDataCollectionItem[source]¶
Bases:
QgsDataItem
- __init__(parent: QgsDataItem | None, name: str | None, path: str | None = '', providerKey: str | None = '')
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. Thepath
string can take any form, but QgsDataCollectionItem 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.- Parameters:
parent (Optional[QgsDataItem])
name (Optional[str])
path (Optional[str] = '')
providerKey (Optional[str] = '')
- addChild(self, item: QgsDataItem | None)[source]¶
- Parameters:
item (Optional[QgsDataItem])
- static homeDirIcon(fillColor: QColor | Qt.GlobalColor = QColor(), strokeColor: QColor | Qt.GlobalColor = QColor()) QIcon [source]¶
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.Added in version 3.4.
- Parameters:
fillColor (Union[QColor, Qt.GlobalColor] = QColor())
strokeColor (Union[QColor, Qt.GlobalColor] = QColor())
- Return type:
QIcon
- static iconDataCollection() QIcon [source]¶
Returns the standard browser data collection icon.
See also
- Return type:
QIcon
- static iconDir(fillColor: QColor | Qt.GlobalColor = QColor(), strokeColor: QColor | Qt.GlobalColor = QColor()) QIcon [source]¶
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, Qt.GlobalColor] = QColor())
strokeColor (Union[QColor, Qt.GlobalColor] = QColor())
- Return type:
QIcon
- static openDirIcon(fillColor: QColor | Qt.GlobalColor = QColor(), strokeColor: QColor | Qt.GlobalColor = QColor()) QIcon [source]¶
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.Added in version 3.4.
- Parameters:
fillColor (Union[QColor, Qt.GlobalColor] = QColor())
strokeColor (Union[QColor, Qt.GlobalColor] = QColor())
- Return type:
QIcon