Class: QgsFavoritesItem¶
- class qgis.core.QgsFavoritesItem(parent: QgsDataItem, name: str, path: str = '')¶
Bases:
QgsDataCollectionItem
Constructor for
QgsFavoritesItem
. Accepts a path argument specifying the file path associated with the item.Contains various Favorites directories
Methods
Adds a new
directory
to the favorites group.- rtype
object
The item is scheduled to be deleted.
Shared home directory icon.
Icon for favorites group
Shared open directory icon.
Refresh the items from a specified list of child items.
Removes an existing directory from the favorites group.
Renames the stored favorite with corresponding
path
a newname
.- rtype
Any
Will request a repaint of this icon.
- addDirectory(self, directory: str, name: str = '')¶
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 (str) –
name (str = '') –
- childEvent(self, QChildEvent)¶
- connectNotify(self, QMetaMethod)¶
- createChildren(self) → object¶
- Return type
object
- customEvent(self, QEvent)¶
- 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() → QIcon¶
Shared home directory icon.
New in version 3.4.
- iconFavorites() → QIcon¶
Icon for favorites group
- Return type
QIcon
- isSignalConnected(self, QMetaMethod) → bool¶
- openDirIcon() → QIcon¶
Shared open directory icon.
New in version 3.4.
- populate(self, children: object)¶
- populate(self, foreground: bool = False) → None
- receivers(self, PYQT_SIGNAL) → int¶
- refresh(self, children: object)¶
Refresh the items from a specified list of child items.
refresh(self)
- removeDirectory(self, item: QgsDirectoryItem)¶
Removes an existing directory from the favorites group.
See also
- Parameters
item (QgsDirectoryItem) –
- renameFavorite(self, path: str, name: str)¶
Renames the stored favorite with corresponding
path
a newname
.- Parameters
path (str) –
name (str) –
- sender(self) → QObject¶
- senderSignalIndex(self) → int¶
- sortKey(self) → Any¶
- Return type
Any
- timerEvent(self, QTimerEvent)¶
- updateIcon(self)¶
Will request a repaint of this icon.
New in version 3.0.