QLibraryInfo Class
La classe `QLibraryInfo` fournit des informations sur les bibliothèques Qt. En savoir plus...
| En-tête : | #include <QLibraryInfo> |
| CMake : | find_package(Qt6 REQUIRED COMPONENTS Core) target_link_libraries(mytarget PRIVATE Qt6::Core) |
| qmake : | QT += core |
Types publics
| enum | LibraryPath { PrefixPath, DocumentationPath, HeadersPath, LibrariesPath, LibraryExecutablesPath, …, SettingsPath } |
Membres publics statiques
| 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() |
Description détaillée
Cette classe fournit une abstraction permettant d’accéder aux informations relatives aux bibliothèques Qt utilisées par l’application, telles que les chemins d’exécution ou la configuration de compilation des bibliothèques Qt.
Les chemins d'exécution par défaut dépendent de la configuration de compilation de Qt, ainsi que du fait que les bibliothèques Qt aient été déplacées ou éventuellement intégrées à l'application.
Vous pouvez utiliser un fichier qt.conf pour remplacer les chemins d'accès par défaut, si votre configuration de déploiement ne correspond pas aux valeurs par défaut. Pour plus d'informations, consultez la documentation « Utilisation de qt.conf ».
Voir également « QSysInfo » et « Utilisation de qt.conf ».
Documentation sur les types de membres
enum QLibraryInfo::LibraryPath
Ce type d'énumération sert à rechercher un chemin d'accès spécifique :
| Constante | Valeur | Description |
|---|---|---|
QLibraryInfo::PrefixPath | 0 | Préfixe par défaut pour tous les chemins d'accès. |
QLibraryInfo::DocumentationPath | 1 | Chemin d'accès à la documentation lors de l'installation. |
QLibraryInfo::HeadersPath | 2 | Chemin d'accès à tous les en-têtes. |
QLibraryInfo::LibrariesPath | 3 | Le chemin d'accès aux bibliothèques installées. |
QLibraryInfo::LibraryExecutablesPath | 4 | Le chemin d'accès aux exécutables installés requis par les bibliothèques lors de l'exécution. |
QLibraryInfo::BinariesPath | 5 | Le chemin d'accès aux binaires Qt installés (outils et applications). |
QLibraryInfo::PluginsPath | 6 | Le chemin d'accès aux plugins Qt installés. |
QLibraryInfo::QmlImportsPath | 7 | Le chemin d'accès aux extensions QML installées à importer. |
QLibraryInfo::Qml2ImportsPath | QmlImportsPath | Cette valeur est obsolète. Utilisez plutôt QmlImportsPath. |
QLibraryInfo::ArchDataPath | 8 | Le chemin d'accès aux données Qt générales dépendantes de l'architecture. |
QLibraryInfo::DataPath | 9 | Le chemin d'accès aux données Qt générales indépendantes de l'architecture. |
QLibraryInfo::TranslationsPath | 10 | Chemin d'accès aux informations de traduction des chaînes Qt. |
QLibraryInfo::ExamplesPath | 11 | Chemin d’accès aux exemples lors de l’installation. |
QLibraryInfo::TestsPath | 12 | Chemin d'accès aux cas de test Qt installés. |
QLibraryInfo::SettingsPath | 100 | Chemin d'accès aux paramètres Qt. Ne s'applique pas sous Windows. |
Voir aussi path().
Documentation des fonctions membres
[static noexcept] bool QLibraryInfo::isDebugBuild()
Renvoie « true » si cette version de Qt a été compilée avec le débogage activé, ou « false » si elle a été compilée en mode production.
[static noexcept, since 6.5] bool QLibraryInfo::isSharedBuild()
Renvoie « true » s'il s'agit d'une version partagée (dynamique) de Qt.
Cette fonction a été introduite dans Qt 6.5.
[static, since 6.0] QString QLibraryInfo::path(QLibraryInfo::LibraryPath p)
Renvoie le chemin spécifié par ` p`.
Si plusieurs chemins sont répertoriés dans qt.conf, seule la première entrée sera renvoyée.
Cette fonction a été introduite dans Qt 6.0.
Voir également paths.
[static, since 6.8] QStringList QLibraryInfo::paths(QLibraryInfo::LibraryPath p)
Renvoie tous les chemins spécifiés par ` p`.
Cette fonction a été introduite dans Qt 6.8.
Voir également path.
[static noexcept] QVersionNumber QLibraryInfo::version()
Renvoie la version de la bibliothèque Qt.
Voir aussi 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.