KFileMetaData::MimeUtils Namespace Reference


QMimeType strictMimeType (const QString &filePath, const QMimeDatabase &db)

Detailed Description

The MimeUtils namespace.

Function Documentation

◆ strictMimeType()

KFILEMETADATA_EXPORT QMimeType KFileMetaData::MimeUtils::strictMimeType ( const QString & filePath,
const QMimeDatabase & db )

Returns the MIME type for a file.

The function uses both content and filename to determine the QMimeType. In case the extension MIME type is more specific than the content MIME type, and the first inherits the latter, the extension MIME type is preferred. If the extension does not match the content, the content has higher priority. The file must exist and be readable.

See also

Definition at line 13 of file mimeutils.cpp.

This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jul 19 2024 11:52:32 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.