QLibraryInfo Class
La classe QLibraryInfo fournit des informations sur la bibliothèque Qt. Plus d'informations...
| 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
De nombreuses informations sont établies lorsque Qt est configuré et construit. Cette classe fournit une abstraction pour accéder à ces informations. En utilisant les fonctions statiques de cette classe, une application peut obtenir des informations sur l'instance de la bibliothèque Qt que l'application utilise au moment de l'exécution.
Vous pouvez également utiliser un fichier qt.conf pour remplacer les chemins d'accès codés en dur qui sont compilés dans la bibliothèque Qt. Pour plus d'informations, voir la documentation Using qt.conf.
Voir aussi QSysInfo et Utilisation de qt.conf.
Documentation sur les types de membres
enum QLibraryInfo::LibraryPath
Ce type d'énumération est utilisé pour rechercher un chemin spécifique :
| Constante | Valeur | Description |
|---|---|---|
QLibraryInfo::PrefixPath | 0 | Préfixe par défaut pour tous les chemins. |
QLibraryInfo::DocumentationPath | 1 | Le chemin vers la documentation lors de l'installation. |
QLibraryInfo::HeadersPath | 2 | Le chemin vers tous les en-têtes. |
QLibraryInfo::LibrariesPath | 3 | Le chemin vers les bibliothèques installées. |
QLibraryInfo::LibraryExecutablesPath | 4 | Le chemin vers les exécutables installés requis par les bibliothèques au moment de l'exécution. |
QLibraryInfo::BinariesPath | 5 | Le chemin vers les binaires Qt installés (outils et applications). |
QLibraryInfo::PluginsPath | 6 | Le chemin vers les plugins Qt installés. |
QLibraryInfo::QmlImportsPath | 7 | Le chemin vers les extensions QML installées à importer. |
QLibraryInfo::Qml2ImportsPath | QmlImportsPath | Cette valeur est obsolète. Utilisez plutôt QmlImportsPath. |
QLibraryInfo::ArchDataPath | 8 | Chemin d'accès aux données Qt dépendant de l'architecture générale. |
QLibraryInfo::DataPath | 9 | Chemin d'accès aux données Qt générales indépendantes de l'architecture. |
QLibraryInfo::TranslationsPath | 10 | Le chemin vers les informations de traduction pour les chaînes Qt. |
QLibraryInfo::ExamplesPath | 11 | Le chemin vers les exemples lors de l'installation. |
QLibraryInfo::TestsPath | 12 | Le chemin vers les cas de test Qt installés. |
QLibraryInfo::SettingsPath | 100 | Chemin d'accès aux paramètres de Qt. Ne s'applique pas à Windows. |
Voir aussi path().
Documentation des fonctions membres
[static noexcept] bool QLibraryInfo::isDebugBuild()
Retourne true si cette version de Qt a été construite avec le débogage activé, ou false si elle a été construite en mode release.
[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.
S'il y a plus d'un chemin listé dans qt.conf, il ne renverra que le premier.
Cette fonction a été introduite dans Qt 6.0.
Voir aussi 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 aussi 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.