![]() |
Home · Overviews · Examples |
The qt.conf file overrides the hard-coded paths that are compiled into the Qt library. These paths are accessible using the QLibraryInfo class. Without qt.conf, the functions in QLibraryInfo return these hard-coded paths; otherwise they return the paths as specified in qt.conf.
Without qt.conf, the Qt libraries will use the hard-coded paths to look for plugins, translations, and so on. These paths may not exist on the target system, or they may not be accesssible. Because of this, you need qt.conf to make the Qt libraries look elsewhere.
QLibraryInfo will load qt.conf from one of the following locations:
Prefix | QCoreApplication::applicationDirPath() |
Documentation | doc |
Headers | include |
Libraries | lib |
Binaries | bin |
Plugins | plugins |
Data | . |
Translations | translations |
Settings | . |
Examples | . |
Demos | . |
For example, a qt.conf file could contain the following:
[Paths] Prefix = /some/path Translations = i18nSubgroups of the Paths group may be used to specify locations for specific versions of the Qt libraries. Such subgroups are of the form Paths/x.y.z, where x is the major version of the Qt libraries, y the minor, and z the patch level. The subgroup that most closely matches the current Qt version is used. If no subgroup matches, the Paths group is used as the fallback. The minor and patch level values may be omitted, in which case they default to zero.
For example, given the following groups:
Paths Paths/4 Paths/4.1 Paths/4.2.5 Paths/6The current version will be matched as shown:
Copyright © 2008 Trolltech | Trademarks | Qt Jambi 4.4.0_01 |