QLibraryInfo Class
The QLibraryInfo class provides information about the Qt libraries. More...
| Header: | #include <QLibraryInfo> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS Core)target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake: | QT += core |
Public Types
| enum | LibraryPath { PrefixPath, DocumentationPath, HeadersPath, LibrariesPath, LibraryExecutablesPath, …, SettingsPath } |
Static Public Members
| bool | isDebugBuild() |
(since 6.5) bool | isSharedBuild() |
(since 6.0) QString | path(QLibraryInfo::LibraryPath p) |
(since 6.8) QStringList | paths(QLibraryInfo::LibraryPath p) |
| QVersionNumber | version() |
Detailed Description
This class provides an abstraction for accessing information about the Qt libraries which the application is using, such as run-time paths, or the build configuration of the Qt libraries.
The default run-time paths depend on the Qt build configuration, as well as whether the Qt libraries have been relocated, and possibly bundled along with the application.
You can use a qt.conf file to override the default paths, in case your deployment situation does not match the defaults. For more information, see the Using qt.conf documentation.
See also QSysInfo and Using qt.conf.
Member Type Documentation
enum QLibraryInfo::LibraryPath
This enum type is used to query for a specific path:
| Constant | Value | Description |
|---|---|---|
QLibraryInfo::PrefixPath | 0 | The default prefix for all paths. |
QLibraryInfo::DocumentationPath | 1 | The path to documentation upon install. |
QLibraryInfo::HeadersPath | 2 | The path to all headers. |
QLibraryInfo::LibrariesPath | 3 | The path to installed libraries. |
QLibraryInfo::LibraryExecutablesPath | 4 | The path to installed executables required by libraries at runtime. |
QLibraryInfo::BinariesPath | 5 | The path to installed Qt binaries (tools and applications). |
QLibraryInfo::PluginsPath | 6 | The path to installed Qt plugins. |
QLibraryInfo::QmlImportsPath | 7 | The path to installed QML extensions to import. |
QLibraryInfo::Qml2ImportsPath | QmlImportsPath | This value is deprecated. Use QmlImportsPath instead. |
QLibraryInfo::ArchDataPath | 8 | The path to general architecture-dependent Qt data. |
QLibraryInfo::DataPath | 9 | The path to general architecture-independent Qt data. |
QLibraryInfo::TranslationsPath | 10 | The path to translation information for Qt strings. |
QLibraryInfo::ExamplesPath | 11 | The path to examples upon install. |
QLibraryInfo::TestsPath | 12 | The path to installed Qt testcases. |
QLibraryInfo::SettingsPath | 100 | The path to Qt settings. Not applicable on Windows. |
See also path().
Member Function Documentation
[static noexcept] bool QLibraryInfo::isDebugBuild()
Returns true if this build of Qt was built with debugging enabled, or false if it was built in release mode.
[static noexcept, since 6.5] bool QLibraryInfo::isSharedBuild()
Returns true if this is a shared (dynamic) build of Qt.
This function was introduced in Qt 6.5.
[static, since 6.0] QString QLibraryInfo::path(QLibraryInfo::LibraryPath p)
Returns the path specified by p.
If there is more than one path listed in qt.conf, it will only return the first one.
This function was introduced in Qt 6.0.
See also paths.
[static, since 6.8] QStringList QLibraryInfo::paths(QLibraryInfo::LibraryPath p)
Returns all paths specificied by p.
This function was introduced in Qt 6.8.
See also path.
[static noexcept] QVersionNumber QLibraryInfo::version()
Returns the version of the Qt library.
See also qVersion().
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.