Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QLibraryInfo Class Reference

\inmodule QtCore More...

#include <qlibraryinfo.h>

+ Collaboration diagram for QLibraryInfo:

Public Types

enum  LibraryPath {
  PrefixPath = 0 , DocumentationPath , HeadersPath , LibrariesPath ,
  LibraryExecutablesPath , BinariesPath , PluginsPath , QmlImportsPath ,
  Qml2ImportsPath = QmlImportsPath , ArchDataPath , DataPath , TranslationsPath ,
  ExamplesPath , TestsPath , SettingsPath = 100
}
 \keyword library location More...
 

Static Public Member Functions

static const char * build () noexcept
 Returns a string describing how this version of Qt was built.
 
static bool isDebugBuild () noexcept Q_DECL_CONST_FUNCTION
 
static bool isSharedBuild () noexcept Q_DECL_CONST_FUNCTION
 
static QVersionNumber version () noexcept Q_DECL_CONST_FUNCTION
 
static QString path (LibraryPath p)
 
static QStringList 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.
 

Detailed Description

\inmodule QtCore

The QLibraryInfo class provides information about the Qt library.

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 \l {Using qt.conf} documentation.

See also
QSysInfo, {Using qt.conf}

Definition at line 13 of file qlibraryinfo.h.

Member Enumeration Documentation

◆ LibraryPath

\keyword library location

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

\value PrefixPath The default prefix for all paths. \value DocumentationPath The path to documentation upon install. \value HeadersPath The path to all headers. \value LibrariesPath The path to installed libraries. \value LibraryExecutablesPath The path to installed executables required by libraries at runtime. \value BinariesPath The path to installed Qt binaries (tools and applications). \value PluginsPath The path to installed Qt plugins. \value QmlImportsPath The path to installed QML extensions to import. \value Qml2ImportsPath This value is deprecated. Use QmlImportsPath instead. \value ArchDataPath The path to general architecture-dependent Qt data. \value DataPath The path to general architecture-independent Qt data. \value TranslationsPath The path to translation information for Qt strings. \value ExamplesPath The path to examples upon install. \value TestsPath The path to installed Qt testcases. \value SettingsPath The path to Qt settings. Not applicable on Windows.

See also
path()
Enumerator
PrefixPath 
DocumentationPath 
HeadersPath 
LibrariesPath 
LibraryExecutablesPath 
BinariesPath 
PluginsPath 
QmlImportsPath 
Qml2ImportsPath 
ArchDataPath 
DataPath 
TranslationsPath 
ExamplesPath 
TestsPath 
SettingsPath 

Definition at line 25 of file qlibraryinfo.h.

Member Function Documentation

◆ build()

const char * QLibraryInfo::build ( )
staticnoexcept

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

Since
5.3

Definition at line 225 of file qlibraryinfo.cpp.

References qt_build_string().

Referenced by QJUnitTestLogger::startLogging(), QPlainTestLogger::startLogging(), and QXmlTestLogger::startLogging().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isDebugBuild()

bool QLibraryInfo::isDebugBuild ( )
staticnoexcept
Since
5.0 Returns true if this build of Qt was built with debugging enabled, or false if it was built in release mode.

Definition at line 236 of file qlibraryinfo.cpp.

Referenced by QWindowsContext::classNamePrefix(), QQuickWidgetPrivate::handleContextCreationFailure(), QSGRenderLoop::handleContextCreationFailure(), init_platform(), and QWindowsWindow::setGeometry().

+ Here is the caller graph for this function:

◆ isSharedBuild()

bool QLibraryInfo::isSharedBuild ( )
staticnoexcept
Since
6.5 Returns true if this is a shared (dynamic) build of Qt.

Definition at line 249 of file qlibraryinfo.cpp.

◆ path()

QString QLibraryInfo::path ( LibraryPath p)
static
Since
6.0 Returns the path specified by p.

Definition at line 520 of file qlibraryinfo.cpp.

References QLibraryInfoPrivate::path().

Referenced by QQmlImportDatabase::QQmlImportDatabase(), QQmlPreviewFileLoader::QQmlPreviewFileLoader(), contextFactory(), QQmlJSLinter::defaultPluginPath(), deployQmlImports(), deployQtFrameworks(), deployQtFrameworks(), QPlatformFontDatabase::fontDir(), QQmlApplicationEnginePrivate::init(), initDefaultPaths(), QLoggingRegistry::initializeRules(), main(), QTest::qFindTestData(), resolveBugListFile(), and ProxyTranslator::setLanguage().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ platformPluginArguments()

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

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}

Since
5.3

Definition at line 630 of file qlibraryinfo.cpp.

References Q_UNUSED, settings, QVariant::toStringList(), and QSettings::value().

Referenced by init_platform().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ version()

QVersionNumber QLibraryInfo::version ( )
staticnoexcept
Since
5.8 Returns the version of the Qt library.
See also
qVersion()

Definition at line 264 of file qlibraryinfo.cpp.

Referenced by init_platform().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following files: