QLibraryInfo Class

The QLibraryInfo class provides information about the Qt library. 更多...

頭: #include <QLibraryInfo>

公共類型

enum LibraryLocation { PrefixPath, DocumentationPath, HeadersPath, LibrariesPath, ..., DemosPath }

靜態公共成員

QDate buildDate ()
QString buildKey ()
QString licensedProducts ()
QString licensee ()
QString location (LibraryLocation loc )

詳細描述

The QLibraryInfo class provides information about the Qt library.

Many pieces of information are established when Qt is configured. Installation paths, license information, and even a unique build key. This class provides an abstraction for accessing this information.

函數 返迴值
buildKey () A string that identifies the Qt version and the configuration. This key is used to ensure that plugins link against the same version of Qt as the application.
location () The path to a certain Qt component (e.g., documentation, header files).
licensee (), licensedProducts () Licensing information.

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 使用 qt.conf 文檔編製。

另請參閱 QSysInfo and 使用 qt.conf .

成員類型文檔編製

enum QLibraryInfo:: LibraryLocation

This enum type is used to specify a specific location specifier:

常量 描述
QLibraryInfo::PrefixPath 0 The default prefix for all paths.
QLibraryInfo::DocumentationPath 1 The location for documentation upon install.
QLibraryInfo::HeadersPath 2 The location for all headers.
QLibraryInfo::LibrariesPath 3 The location of installed libraries.
QLibraryInfo::BinariesPath 4 The location of installed Qt binaries (tools and applications).
QLibraryInfo::PluginsPath 5 The location of installed Qt plugins.
QLibraryInfo::ImportsPath 11 The location of installed QML extensions to import.
QLibraryInfo::DataPath 6 The location of general Qt data.
QLibraryInfo::TranslationsPath 7 The location of translation information for Qt strings.
QLibraryInfo::SettingsPath 8 The location for Qt settings.
QLibraryInfo::ExamplesPath 10 The location for examples upon install.
QLibraryInfo::DemosPath 9 The location for demos upon install.

另請參閱 location ().

成員函數文檔編製

[static] QDate QLibraryInfo:: buildDate ()

Returns the installation date for this build of Qt. The install date will usually be the last time that Qt sources were configured.

該函數在 Qt 4.6 引入。

[static] QString QLibraryInfo:: buildKey ()

Returns a unique key identifying this build of Qt and its configurations. This key is not globally unique, rather only useful for establishing of two configurations are compatible. This can be used to compare with the QT_BUILD_KEY preprocessor symbol.

另請參閱 location ().

[static] QString QLibraryInfo:: licensedProducts ()

Returns the products that the license for this build of Qt has access to.

另請參閱 licensee ().

[static] QString QLibraryInfo:: licensee ()

Returns the person to whom this build of Qt is licensed.

另請參閱 licensedProducts ().

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

Returns the location specified by loc .