QLibraryInfo Class

The QLibraryInfo class provides information about the Qt library. More...

Header: #include <QLibraryInfo>

Public Types

LibraryLocation
enum LibraryPath { PrefixPath, DocumentationPath, HeadersPath, LibrariesPath, LibraryExecutablesPath, …, SettingsPath }

Static Public Members

const char *build()
bool isDebugBuild()
bool isSharedBuild()
QString location(LibraryLocation loc)
QString path(LibraryPath p)
QStringList platformPluginArguments(const QString &platformName)
QVersionNumber version()

Detailed Description

\inmoduleQtCore

Many pieces of information are established when Qt is configured and built. This class provides an abstraction for accessing that information. By using the static functions of this class, an application can obtain information about the instance of the Qt library which the application is using at run-time.

You can also use a qt.conf file to override the hard-coded paths that are compiled into the Qt library. For more information, see the Using qt.conf documentation.

See also QSysInfo and Using qt.conf.

Member Type Documentation

[alias] QLibraryInfo::LibraryLocation

\deprecatedUse LibraryPath with QLibraryInfo::path() instead.

enum QLibraryInfo::LibraryPath

This enum type is used to query for a specific path:

ConstantValueDescription
QLibraryInfo::PrefixPath0The default prefix for all paths.
QLibraryInfo::DocumentationPath1The path to documentation upon install.
QLibraryInfo::HeadersPath2The path to all headers.
QLibraryInfo::LibrariesPath3The path to installed libraries.
QLibraryInfo::LibraryExecutablesPath4The path to installed executables required by libraries at runtime.
QLibraryInfo::BinariesPath5The path to installed Qt binaries (tools and applications).
QLibraryInfo::PluginsPath6The path to installed Qt plugins.
QLibraryInfo::QmlImportsPath7The path to installed QML extensions to import.
QLibraryInfo::Qml2ImportsPathQmlImportsPathThis value is deprecated. Use QmlImportsPath instead.
QLibraryInfo::ArchDataPath8The path to general architecture-dependent Qt data.
QLibraryInfo::DataPath9The path to general architecture-independent Qt data.
QLibraryInfo::TranslationsPath10The path to translation information for Qt strings.
QLibraryInfo::ExamplesPath11The path to examples upon install.
QLibraryInfo::TestsPath12The path to installed Qt testcases.
QLibraryInfo::SettingsPath100The path to Qt settings. Not applicable on Windows.

See also path().

Member Function Documentation

[static noexcept] const char *QLibraryInfo::build()

Returns a string describing how this version of Qt was built.

\internal

\since5.3

[static noexcept] bool QLibraryInfo::isDebugBuild()

\since5.0 Returns true if this build of Qt was built with debugging enabled, or false if it was built in release mode.

[static noexcept] bool QLibraryInfo::isSharedBuild()

\since6.5 Returns true if this is a shared (dynamic) build of Qt.

[static] QString QLibraryInfo::location(LibraryLocation loc)

\deprecated[6.0] Use path() instead.

Returns the path specified by loc.

[static] QString QLibraryInfo::path(LibraryPath p)

\since6.0 Returns the path specified by p.

[static] QStringList QLibraryInfo::platformPluginArguments(const QString &platformName)

Returns additional arguments to the platform plugin matching platformName which can be specified as a string list using the key Arguments in a group called Platforms of the qt.conf file.

sa {Using qt.conf}

\internal

\since5.3

[static noexcept] QVersionNumber QLibraryInfo::version()

\since5.8 Returns the version of the Qt library.

See also qVersion().