Class: QgsFavoritesItem¶
A browser item which contains various Favorites directories.
Class Hierarchy¶
Base classes¶
A browser item for collections of data. |
|
Base class for all items in the model. |
|
Methods
Adds a new directory to the favorites group. |
|
Removes an existing directory from the favorites group. |
|
Renames the stored favorite with corresponding path a new name. |
Static Methods
Icon for favorites group |
- class qgis.core.QgsFavoritesItem[source]¶
Bases:
QgsDataCollectionItem
- __init__(parent: QgsDataItem | None, name: str | None, path: str | None = '')
Constructor for QgsFavoritesItem. Accepts a path argument specifying the file path associated with the item.
- Parameters:
parent (Optional[QgsDataItem])
name (Optional[str])
path (Optional[str] = '')
- addDirectory(self, directory: str | None, name: str | None = '')[source]¶
Adds a new
directory
to the favorites group.If
name
is specified, it will be used as the favorite’s name. Otherwise the name will be set to matchdirectory
.See also
- Parameters:
directory (Optional[str])
name (Optional[str] = '')
- removeDirectory(self, item: QgsDirectoryItem | None)[source]¶
Removes an existing directory from the favorites group.
See also
- Parameters:
item (Optional[QgsDirectoryItem])