Skip to content

PythonQt.QtCore.QFileInfo · declarations 002

Back to PythonQt.QtCore.QFileInfo

size

size() -> int

X.size() -> int

Supplemental documentation: Qt 5 reference:

qint64 QFileInfo::size() const

Returns the file size in bytes. If the file does not exist or cannot be fetched, 0 is returned.

If the file is a symlink, the size of the target file is returned (not the symlink).

See also exists().

Upstream PySide2 reference signatures (binding differences may apply):

size(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qfileinfo.html#size

suffix

suffix() -> str

X.suffix() -> str

Supplemental documentation: Qt 5 reference:

QString QFileInfo::suffix() const

Returns the suffix (extension) of the file.

The suffix consists of all characters in the file after (but not including) the last '.'.

Example:

QFileInfo fi("/temporary/archive.tar.gz");
QString ext = fi.suffix();  // ext = "gz"

The suffix of a file is computed equally on all platforms, independent of file naming conventions (e.g., ".bashrc" on Unix has an empty base name, and the suffix is "bashrc").

See also fileName(), completeSuffix(), baseName(), and completeBaseName().

Upstream PySide2 reference signatures (binding differences may apply):

suffix(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qfileinfo.html#suffix

swap

swap(other: Any) -> None

X.swap(other)

Supplemental documentation: Qt 5 reference:

void QFileInfo::swap(QFileInfo \&other)

Swaps this file info with other. This function is very fast and never fails.

This function was introduced in Qt 5.0.

Upstream PySide2 reference signatures (binding differences may apply):

swap(self, other: PySide2.QtCore.QFileInfo) -> None

Source: https://doc.qt.io/archives/qt-5.15/qfileinfo.html#swap

symLinkTarget

symLinkTarget() -> str

X.symLinkTarget() -> str

Supplemental documentation: Qt 5 reference:

QString QFileInfo::symLinkTarget() const

Returns the absolute path to the file or directory a symbolic link points to, or an empty string if the object isn't a symbolic link.

This name may not represent an existing file; it is only a string. QFileInfo::exists() returns true if the symlink points to an existing file.

This function was introduced in Qt 4.2.

See also exists(), isSymLink(), isDir(), and isFile().

Upstream PySide2 reference signatures (binding differences may apply):

symLinkTarget(self) -> str

Source: https://doc.qt.io/archives/qt-5.15/qfileinfo.html#symLinkTarget