New in version 5.0.
def
__eq__
(other)
def
__ne__
(other)
def
aliases
()
def
allAncestors
()
def
comment
()
def
filterString
()
def
genericIconName
()
def
globPatterns
()
def
iconName
()
def
继承
(mimeTypeName)
def
isDefault
()
def
isValid
()
def
name
()
def
parentMimeTypes
()
def
preferredSuffix
()
def
suffixes
()
def
swap
(other)
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
iconfor the file, or even the descriptivecommentin detailed views.To check if a file has the expected MIME type, you should use
inherits()rather than a simple string comparison based on thename(). 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.
QMimeType
¶
QMimeType(other)
- param other
Constructs this
QMimeType
object initialized with default property values that indicate an invalid MIME type.
PySide2.QtCore.QMimeType.
aliases
(
)
¶
字符串列表
PySide2.QtCore.QMimeType.
allAncestors
(
)
¶
字符串列表
PySide2.QtCore.QMimeType.
comment
(
)
¶
unicode
PySide2.QtCore.QMimeType.
filterString
(
)
¶
unicode
PySide2.QtCore.QMimeType.
genericIconName
(
)
¶
unicode
PySide2.QtCore.QMimeType.
globPatterns
(
)
¶
字符串列表
PySide2.QtCore.QMimeType.
iconName
(
)
¶
unicode
PySide2.QtCore.QMimeType.
继承
(
mimeTypeName
)
¶
mimeTypeName – unicode
bool
返回
true
if this mimetype is
mimeTypeName
, or inherits
mimeTypeName
(见
parentMimeTypes()
),或
mimeTypeName
is an alias for this mimetype.
This method has been made invokable from QML since 5.10.
PySide2.QtCore.QMimeType.
isDefault
(
)
¶
bool
PySide2.QtCore.QMimeType.
isValid
(
)
¶
bool
PySide2.QtCore.QMimeType.
name
(
)
¶
unicode
PySide2.QtCore.QMimeType.
__ne__
(
other
)
¶
other
–
QMimeType
bool
返回
true
if
other
does not equal this
QMimeType
object, otherwise returns
false
.
PySide2.QtCore.QMimeType.
__eq__
(
other
)
¶
other
–
QMimeType
bool
返回
true
if
other
equals this
QMimeType
object, otherwise returns
false
. The name is the unique identifier for a mimetype, so two mimetypes with the same name, are equal.
PySide2.QtCore.QMimeType.
parentMimeTypes
(
)
¶
字符串列表
PySide2.QtCore.QMimeType.
preferredSuffix
(
)
¶
unicode
PySide2.QtCore.QMimeType.
suffixes
(
)
¶
字符串列表
PySide2.QtCore.QMimeType.
swap
(
other
)
¶
other
–
QMimeType
交换
QMimeType
other
with this
QMimeType
对象。
此操作非常快且从不失败。
The method helps with the implementation of assignment operators in an exception-safe way. For more information consult More C++ Idioms - Copy-and-swap .