Skip to content

PythonQt.Qt.QStorageInfo

QStorageInfo

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

Allows retrieving information about the volume's space, its mount point, label, and filesystem name.

You can create an instance of QStorageInfo by passing the path to the volume's mount point as a constructor parameter, or you can set it using the setPath() method. The static mountedVolumes() method can be used to get the list of all mounted filesystems.

QStorageInfo always caches the retrieved information, but you can call refresh() to invalidate the cache.

The following example retrieves the most common information about the root volume of the system, and prints information about it.

    QStorageInfo storage = QStorageInfo::root();

    qDebug() << storage.rootPath();
    if (storage.isReadOnly())
        qDebug() << "isReadOnly:" << storage.isReadOnly();

    qDebug() << "name:" << storage.name();
    qDebug() << "fileSystemType:" << storage.fileSystemType();
    qDebug() << "size:" << storage.bytesTotal()/1000/1000 << "MB";
    qDebug() << "availableSize:" << storage.bytesAvailable()/1000/1000 << "MB";

Source: https://doc.qt.io/archives/qt-5.15/qstorageinfo.html

Complete member index

Every captured member retains its own identity. Identical captured declaration text is linked once; this does not establish native inheritance or interchangeable objects.

Member Kind Signature Summary
__init__ function (self, *args: Any, **kwargs: Any) -> None Native constructor; consult class documentation for supported overloads. (shared captured text)
blockSize function (self) -> int X.blockSize() -> int (shared captured text)
bytesAvailable function (self) -> int X.bytesAvailable() -> int (shared captured text)
bytesFree function (self) -> int X.bytesFree() -> int (shared captured text)
bytesTotal function (self) -> int X.bytesTotal() -> int (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
device function (self) -> Any X.device() -> PythonQt.QtCore.QByteArray (shared captured text)
displayName function (self) -> str X.displayName() -> str (shared captured text)
fileSystemType function (self) -> Any X.fileSystemType() -> PythonQt.QtCore.QByteArray (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> Any Returns if the class inherits or is of given type name (shared captured text)
isReadOnly function (self) -> bool X.isReadOnly() -> bool (shared captured text)
isReady function (self) -> bool X.isReady() -> bool (shared captured text)
isRoot function (self) -> bool X.isRoot() -> bool (shared captured text)
isValid function (self) -> bool X.isValid() -> bool (shared captured text)
mountedVolumes function (self) -> tuple X.mountedVolumes() -> tuple (shared captured text)
name function (self) -> str X.name() -> str (shared captured text)
operator_assign function (self, other: Any) -> Any X.operator_assign(other) -> PythonQt.QtCore.QStorageInfo (shared captured text)
refresh function (self) -> None Resets [QStorageInfo](https://doc.qt.io/archives/qt-5.15/qstorageinfo.html)'s internal cache. (shared captured text)
root function (self) -> Any X.root() -> PythonQt.QtCore.QStorageInfo (shared captured text)
rootPath function (self) -> str X.rootPath() -> str (shared captured text)
setPath function (self, path: str) -> None Sets this [QStorageInfo](https://doc.qt.io/archives/qt-5.15/qstorageinfo.html) object to the filesystem mounted where path is located. (shared captured text)
swap function (self, other: Any) -> None Swaps this volume info with other. (shared captured text)