Class: QgsDirectoryItem

class qgis.core.QgsDirectoryItem(parent: QgsDataItem, name: str, path: str)

Bases: QgsDataCollectionItem

Constructor for QgsDirectoryItem, with the specified parent item.

The name argument specifies the text to show in the model for the item. This is usually the directory name, but in certain cases may differ for special directories (e.g. “Home”). If a non-directory-name text is used, it should be a translated string when appropriate.

The path argument specifies the directory path in the file system (e.g. “/home/gsherman/stuff”). A valid directory path must be specified.

QgsDirectoryItem(parent: QgsDataItem, name: str, dirPath: str, path: str, providerKey: str = ‘’) Constructor for QgsDirectoryItem, with the specified parent item.

The name argument specifies the text to show in the model for the item. This is usually the directory name, but in certain cases may differ for special directories (e.g. “Home”). If a non-directory-name text is used, it should be a translated string when appropriate.

The dirPath argument specifies the directory path in the file system (e.g. “/home/gsherman/stuff”). A valid directory path must be specified.

The path argument gives the item path in the browser tree. The path string can take any form, but is usually the same as dirPath or dirPath with a prefix, e.g. “favorites:/home/gsherman/Downloads”). QgsDirectoryItem items pointing to different dirPaths should always use a different item path.

The optional providerKey string can be used to specify the key for the QgsDataItemProvider that created this item.

A directory: contains subdirectories and layers

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

object

customEvent()
deferredDelete()
dirPath(self) → str

Returns the full path to the directory the item represents.

Return type

str

directoryChanged(self)
disconnectNotify()
equal(self, other: QgsDataItem) → bool
Parameters

other (QgsDataItem) –

Return type

bool

hasDragEnabled(self) → bool
Return type

bool

hiddenPath(path: str) → bool

Check if the given path is hidden from the browser model

Parameters

path (str) –

Return type

bool

homeDirIcon()
icon(self) → QIcon
Return type

QIcon

init(self)
isSignalConnected()
mimeUri(self) → QgsMimeDataUtils.Uri
Return type

QgsMimeDataUtils.Uri

openDirIcon()
paramWidget(self) → QWidget
Return type

QWidget

populate()
receivers()
refresh()
sender()
senderSignalIndex()
setState(self, state: QgsDataItem.State)
Parameters

state (QgsDataItem.State) –

timerEvent()
updateIcon()