Skip to content

PythonQt.Qt.QMimeType

QMimeType

PythonQtInstanceWrapper object

Native bases: PythonQtInstanceWrapper

Supplemental documentation: Qt 5 reference:

Detailed Description

For instance a file named "readme.txt" has the MIME type "text/plain". The MIME type can be determined from the file name, or from the file contents, or from both. MIME type determination can also be done on buffers of data not coming from files.

Determining the MIME type of a file can be useful to make sure your application supports it. It is also useful in file-manager-like applications or widgets, in order to display an appropriate icon for the file, or even the descriptive comment in detailed views.

To check if a file has the expected MIME type, you should use inherits() rather than a simple string comparison based on the name(). This is because MIME types can inherit from each other: for instance a C source file is a specific type of plain text file, so text/x-csrc inherits text/plain.

Source: https://doc.qt.io/archives/qt-5.15/qmimetype.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)
aliases function (self) -> tuple X.aliases() -> tuple (shared captured text)
allAncestors function (self) -> tuple X.allAncestors() -> tuple (shared captured text)
className function (self, *args: Any, **kwargs: Any) -> Any Return the classname of the object (shared captured text)
comment function (self) -> str X.comment() -> str (shared captured text)
delete function (self, *args: Any, **kwargs: Any) -> Any Deletes the C++ object (at your own risk, my friend!) (shared captured text)
filterString function (self) -> str X.filterString() -> str (shared captured text)
genericIconName function (self) -> str X.genericIconName() -> str (shared captured text)
globPatterns function (self) -> tuple X.globPatterns() -> tuple (shared captured text)
help function (self, *args: Any, **kwargs: Any) -> Any Shows the help of available methods for this class (shared captured text)
iconName function (self) -> str X.iconName() -> str (shared captured text)
inherits function (self, *args: Any, **kwargs: Any) -> bool Returns if the class inherits or is of given type name (shared captured text)
isDefault function (self) -> bool X.isDefault() -> bool (shared captured text)
isValid function (self) -> bool X.isValid() -> bool (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.QMimeType (shared captured text)
parentMimeTypes function (self) -> tuple X.parentMimeTypes() -> tuple (shared captured text)
preferredSuffix function (self) -> str X.preferredSuffix() -> str (shared captured text)
suffixes function (self) -> tuple X.suffixes() -> tuple (shared captured text)
swap function (self, other: Any) -> None Swaps [QMimeType](https://doc.qt.io/archives/qt-5.15/qmimetype.html) other with this [QMimeType](https://doc.qt.io/archives/qt-5.15/qmimetype.html) object. (shared captured text)