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

New in version 3.0.

Parameters
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 match directory.

Parameters
  • directory (str) –

  • name (str = '') –

childEvent()
connectNotify()
createChildren(self) → object
Return type

object

customEvent()
deferredDelete()
disconnectNotify()
homeDirIcon()
iconFavorites() → QIcon

Icon for favorites group

Return type

QIcon

isSignalConnected()
openDirIcon()
populate()
receivers()
refresh()
removeDirectory(self, item: QgsDirectoryItem)

Removes an existing directory from the favorites group.

See also

addDirectory()

Parameters

item (QgsDirectoryItem) –

renameFavorite(self, path: str, name: str)

Renames the stored favorite with corresponding path a new name.

Parameters
  • path (str) –

  • name (str) –

sender()
senderSignalIndex()
sortKey(self) → Any
Return type

Any

timerEvent()
updateIcon()