Skip to content

PythonQt.QtGui.QDirModel · declarations 001

Back to PythonQt.QtGui.QDirModel

FileIconRole instance-attribute

FileIconRole: Any

FileNameRole instance-attribute

FileNameRole: Any

FilePathRole instance-attribute

FilePathRole: Any

Roles instance-attribute

Roles: type

int([x]) -> integer int(x, base=10) -> integer

Convert a number or string to an integer, or return 0 if no arguments are given. If x is a number, return x.int(). For floating point numbers, this truncates towards zero.

If x is not a number or if base is given, then x must be a string, bytes, or bytearray instance representing an integer literal in the given base. The literal can be preceded by '+' or '-' and be surrounded by whitespace. The base defaults to 10. Valid bases are 0 and 2-36. Base 0 means to interpret the base from the string as an integer literal.

int('0b100', base=0) 4

columnCount

columnCount(parent: Any) -> int

X.columnCount(parent) -> int

Supplemental documentation: Qt 5 reference:

[override virtual] int QDirModel::columnCount(const QModelIndex \&parent \= QModelIndex()) const

Reimplements: QAbstractItemModel::columnCount(const QModelIndex \&parent) const.

Returns the number of columns in the parent model item.

Upstream PySide2 reference signatures (binding differences may apply):

columnCount(self, parent: PySide2.QtCore.QModelIndex=...) -> int

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#columnCount

columnsAboutToBeInserted

columnsAboutToBeInserted(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.columnsAboutToBeInserted; argument details are not documented.

columnsAboutToBeMoved

columnsAboutToBeMoved(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.columnsAboutToBeMoved; argument details are not documented.

columnsAboutToBeRemoved

columnsAboutToBeRemoved(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.columnsAboutToBeRemoved; argument details are not documented.

columnsInserted

columnsInserted(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.columnsInserted; argument details are not documented.

columnsMoved

columnsMoved(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.columnsMoved; argument details are not documented.

columnsRemoved

columnsRemoved(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.columnsRemoved; argument details are not documented.

data

data(index: Any, role: int) -> Any

X.data(index, role) -> object

Supplemental documentation: Qt 5 reference:

[override virtual] QVariant QDirModel::data(const QModelIndex \&index, int role \= Qt::DisplayRole) const

Reimplements: QAbstractItemModel::data(const QModelIndex \&index, int role) const.

Returns the data for the model item index with the given role.

See also setData().

Upstream PySide2 reference signatures (binding differences may apply):

data(self, index: PySide2.QtCore.QModelIndex, role: int=...) -> typing.Any

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#data

dataChanged

dataChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.dataChanged; argument details are not documented.

destroyed

destroyed(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.destroyed; argument details are not documented.

dropMimeData

dropMimeData(data: Any, action: Any, row: int, column: int, parent: Any) -> bool

X.dropMimeData(data, action, row, column, parent) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual] bool QDirModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex \&parent)

Reimplements: QAbstractItemModel::dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex \&parent).

Handles the data supplied by a drag and drop operation that ended with the given action over the row in the model specified by the row and column and by the parent index.

Returns true if the drop was successful, and false otherwise.

See also supportedDropActions().

Upstream PySide2 reference signatures (binding differences may apply):

dropMimeData(self, data: PySide2.QtCore.QMimeData, action: PySide2.QtCore.Qt.DropAction, row: int, column: int, parent: PySide2.QtCore.QModelIndex) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#dropMimeData

fileIcon

fileIcon(index: Any) -> Any

X.fileIcon(index) -> PythonQt.QtGui.QIcon

Supplemental documentation: Qt 5 reference:

QIcon QDirModel::fileIcon(const QModelIndex \&index) const

Returns the icons for the item stored in the model under the given index.

Upstream PySide2 reference signatures (binding differences may apply):

fileIcon(self, index: PySide2.QtCore.QModelIndex) -> PySide2.QtGui.QIcon

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#fileIcon

fileInfo

fileInfo(index: Any) -> Any

X.fileInfo(index) -> PythonQt.QtCore.QFileInfo

Supplemental documentation: Qt 5 reference:

QFileInfo QDirModel::fileInfo(const QModelIndex \&index) const

Returns the file information for the specified model index.

Note: If the model index represents a symbolic link in the underlying filing system, the file information returned will contain information about the symbolic link itself, regardless of whether resolveSymlinks is enabled or not.

See also QFileInfo::symLinkTarget().

Upstream PySide2 reference signatures (binding differences may apply):

fileInfo(self, index: PySide2.QtCore.QModelIndex) -> PySide2.QtCore.QFileInfo

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#fileInfo

fileName

fileName(index: Any) -> str

X.fileName(index) -> str

Supplemental documentation: Qt 5 reference:

QString QDirModel::fileName(const QModelIndex \&index) const

Returns the name of the item stored in the model under the index given.

Upstream PySide2 reference signatures (binding differences may apply):

fileName(self, index: PySide2.QtCore.QModelIndex) -> str

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#fileName

filePath

filePath(index: Any) -> str

X.filePath(index) -> str

Supplemental documentation: Qt 5 reference:

QString QDirModel::filePath(const QModelIndex \&index) const

Returns the path of the item stored in the model under the index given.

Upstream PySide2 reference signatures (binding differences may apply):

filePath(self, index: PySide2.QtCore.QModelIndex) -> str

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#filePath

filter

filter() -> Any

X.filter()

Supplemental documentation: Qt 5 reference:

QDir::Filters QDirModel::filter() const

Returns the filter specification for the directory model.

See also setFilter() and QDir::Filters.

Upstream PySide2 reference signatures (binding differences may apply):

filter(self) -> PySide2.QtCore.QDir.Filters

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#filter

flags

flags(index: Any) -> Any

X.flags(index)

Supplemental documentation: Qt 5 reference:

[override virtual] Qt::ItemFlags QDirModel::flags(const QModelIndex \&index) const

Reimplements: QAbstractItemModel::flags(const QModelIndex \&index) const.

Returns the item flags for the given index in the model.

See also Qt::ItemFlags.

Upstream PySide2 reference signatures (binding differences may apply):

flags(self, index: PySide2.QtCore.QModelIndex) -> PySide2.QtCore.Qt.ItemFlags

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#flags

hasChildren

hasChildren(index: Any) -> bool

X.hasChildren(index) -> bool

Supplemental documentation: Qt 5 reference:

[override virtual] bool QDirModel::hasChildren(const QModelIndex \&parent \= QModelIndex()) const

Reimplements: QAbstractItemModel::hasChildren(const QModelIndex \&parent) const.

Returns true if the parent model item has children; otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

hasChildren(self, index: PySide2.QtCore.QModelIndex=...) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#hasChildren

headerData

headerData(section: int, orientation: Any, role: int) -> Any

X.headerData(section, orientation, role) -> object

Supplemental documentation: Qt 5 reference:

[override virtual] QVariant QDirModel::headerData(int section, Qt::Orientation orientation, int role \= Qt::DisplayRole) const

Reimplements: QAbstractItemModel::headerData(int section, Qt::Orientation orientation, int role) const.

Returns the data stored under the given role for the specified section of the header with the given orientation.

Upstream PySide2 reference signatures (binding differences may apply):

headerData(self, section: int, orientation: PySide2.QtCore.Qt.Orientation, role: int=...) -> typing.Any

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#headerData

headerDataChanged

headerDataChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.headerDataChanged; argument details are not documented.

iconProvider

iconProvider() -> Any

X.iconProvider() -> PythonQt.QtGui.QFileIconProvider

Supplemental documentation: Qt 5 reference:

QFileIconProvider *QDirModel::iconProvider() const

Returns the file icon provider for this directory model.

See also setIconProvider().

Upstream PySide2 reference signatures (binding differences may apply):

iconProvider(self) -> PySide2.QtWidgets.QFileIconProvider

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#iconProvider

index

index(row: Any, column: int, parent: Any) -> Any

X.index(row, column, parent) -> PythonQt.QtCore.QModelIndex

Supplemental documentation: Qt 5 reference:

[override virtual] QModelIndex QDirModel::index(int row, int column, const QModelIndex \&parent \= QModelIndex()) const

Reimplements: QAbstractItemModel::index(int row, int column, const QModelIndex \&parent) const.

Returns the model item index for the item in the parent with the given row and column.

QModelIndex QDirModel::index(const QString \&path, int column \= 0) const

This is an overloaded function.

Returns the model item index for the given path.

Upstream PySide2 reference signatures (binding differences may apply):

index(self, path: str, column: int=...) -> PySide2.QtCore.QModelIndex
index(self, row: int, column: int, parent: PySide2.QtCore.QModelIndex=...) -> PySide2.QtCore.QModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#index

isDir

isDir(index: Any) -> bool

X.isDir(index) -> bool

Supplemental documentation: Qt 5 reference:

bool QDirModel::isDir(const QModelIndex \&index) const

Returns true if the model item index represents a directory; otherwise returns false.

Upstream PySide2 reference signatures (binding differences may apply):

isDir(self, index: PySide2.QtCore.QModelIndex) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#isDir

isReadOnly

isReadOnly() -> bool

X.isReadOnly() -> bool

Upstream PySide2 reference signatures (binding differences may apply):

isReadOnly(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#isReadOnly

layoutAboutToBeChanged

layoutAboutToBeChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.layoutAboutToBeChanged; argument details are not documented.

layoutChanged

layoutChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.layoutChanged; argument details are not documented.

lazyChildCount instance-attribute

lazyChildCount: bool

Qt 5 reference:

lazyChildCount : bool

This property holds whether the directory model optimizes the hasChildren function to only check if the item is a directory.

If this property is set to false, the directory model will make sure that a directory actually containes any files before reporting that it has children. Otherwise the directory model will report that an item has children if the item is a directory.

This property is false by default

Access functions:

bool lazyChildCount() const
void setLazyChildCount(bool enable)

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#lazyChildCount

mimeData

mimeData(indexes: Any) -> Any

X.mimeData(indexes) -> PythonQt.QtCore.QMimeData

Supplemental documentation: Qt 5 reference:

[override virtual] QMimeData *QDirModel::mimeData(const QModelIndexList \&indexes) const

Reimplements: QAbstractItemModel::mimeData(const QModelIndexList \&indexes) const.

Returns an object that contains a serialized description of the specified indexes. The format used to describe the items corresponding to the indexes is obtained from the mimeTypes() function.

If the list of indexes is empty, 0 is returned rather than a serialized empty list.

Upstream PySide2 reference signatures (binding differences may apply):

mimeData(self, indexes: typing.List[int]) -> PySide2.QtCore.QMimeData

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#mimeData

mimeTypes

mimeTypes() -> tuple

X.mimeTypes() -> tuple

Supplemental documentation: Qt 5 reference:

[override virtual] QStringList QDirModel::mimeTypes() const

Reimplements: QAbstractItemModel::mimeTypes() const.

Returns a list of MIME types that can be used to describe a list of items in the model.

Upstream PySide2 reference signatures (binding differences may apply):

mimeTypes(self) -> typing.List[str]

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#mimeTypes

mkdir

mkdir(parent: Any, name: str) -> Any

X.mkdir(parent, name) -> PythonQt.QtCore.QModelIndex

Supplemental documentation: Qt 5 reference:

QModelIndex QDirModel::mkdir(const QModelIndex \&parent, const QString \&name)

Create a directory with the name in the parent model item.

Upstream PySide2 reference signatures (binding differences may apply):

mkdir(self, parent: PySide2.QtCore.QModelIndex, name: str) -> PySide2.QtCore.QModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#mkdir

modelAboutToBeReset

modelAboutToBeReset(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.modelAboutToBeReset; argument details are not documented.

modelReset

modelReset(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.modelReset; argument details are not documented.

nameFilters

nameFilters() -> tuple

X.nameFilters() -> tuple

Supplemental documentation: Qt 5 reference:

QStringList QDirModel::nameFilters() const

Returns a list of filters applied to the names in the model.

See also setNameFilters().

Upstream PySide2 reference signatures (binding differences may apply):

nameFilters(self) -> typing.List[str]

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#nameFilters

objectNameChanged

objectNameChanged(*args: Any, **kwargs: Any) -> Any

Native PythonQt.QtGui.QDirModel.objectNameChanged; argument details are not documented.

parent

parent(child: Any) -> Any

X.parent(child) -> PythonQt.QtCore.QModelIndex

Supplemental documentation: Qt 5 reference:

[override virtual] QModelIndex QDirModel::parent(const QModelIndex \&child) const

Reimplements: QAbstractItemModel::parent(const QModelIndex \&index) const.

Return the parent of the given child model item.

Upstream PySide2 reference signatures (binding differences may apply):

parent(self) -> PySide2.QtCore.QObject
parent(self, child: PySide2.QtCore.QModelIndex) -> PySide2.QtCore.QModelIndex

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#parent

readOnly instance-attribute

readOnly: Any

Qt 5 reference:

readOnly : bool

This property holds whether the directory model allows writing to the file system

If this property is set to false, the directory model will allow renaming, copying and deleting of files and directories.

This property is true by default

Access functions:

bool isReadOnly() const
void setReadOnly(bool enable)

Source: https://doc.qt.io/archives/qt-5.15/qdirmodel.html#readOnly