Class: QgsDirectoryItem

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

Bases: QgsDataCollectionItem

QgsDirectoryItem(parent: QgsDataItem, name: str, dirPath: str, path: str) Constructor.

Parameters
  • parent (QgsDataItem) –

  • name (str) – directory name

  • dirPath – path to directory in file system

  • path (str) – item path in the tree, it may be dirPath or dirPath with some prefix, e.g. favorites: *

A directory: contains subdirectories and layers

Methods

childEvent

childrenCreated

connectNotify

createChildren

rtype

object

customEvent

deferredDelete

The item is scheduled to be deleted.

dirPath

Returns the full path to the directory the item represents.

directoryChanged

disconnectNotify

equal

param other

hasDragEnabled

rtype

bool

hiddenPath

Check if the given path is hidden from the browser model

homeDirIcon

Shared home directory icon.

icon

rtype

QIcon

init

isSignalConnected

mimeUri

rtype

QgsMimeDataUtils.Uri

openDirIcon

Shared open directory icon.

paramWidget

rtype

QWidget

populate

populate(self, foreground: bool = False)

receivers

refresh

Refresh the items from a specified list of child items.

sender

senderSignalIndex

setState

param state

timerEvent

updateIcon

Will request a repaint of this icon.

childEvent(self, QChildEvent)
childrenCreated(self)
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), the deferredDelete() returns True and item will be deleted once Populating finished. Items with slow reateChildren() (for example network or database based) may check during createChildren() if deferredDelete() returns True and return from createChildren() immediately because result will be useless. *

dirPath(self) → str

Returns the full path to the directory the item represents.

Return type

str

directoryChanged(self)
disconnectNotify(self, QMetaMethod)
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() → QIcon

Shared home directory icon.

New in version 3.4.

icon(self) → QIcon
Return type

QIcon

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

QgsMimeDataUtils.Uri

openDirIcon() → QIcon

Shared open directory icon.

New in version 3.4.

paramWidget(self) → QWidget
Return type

QWidget

populate(self, children: object)

populate(self, foreground: bool = False)

receivers(self, PYQT_SIGNAL) → int
refresh(self, children: object)

Refresh the items from a specified list of child items.

refresh(self)

sender(self) → QObject
senderSignalIndex(self) → int
setState(self, state: QgsDataItem.State)
Parameters

state (QgsDataItem.State) –

timerEvent(self, QTimerEvent)
updateIcon(self)

Will request a repaint of this icon.

New in version 3.0.