[556] | 1 | /****************************************************************************
|
---|
| 2 | **
|
---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
---|
| 4 | ** All rights reserved.
|
---|
| 5 | ** Contact: Nokia Corporation ([email protected])
|
---|
| 6 | **
|
---|
| 7 | ** This file is part of the documentation of the Qt Toolkit.
|
---|
| 8 | **
|
---|
| 9 | ** $QT_BEGIN_LICENSE:LGPL$
|
---|
| 10 | ** Commercial Usage
|
---|
| 11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
| 12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
| 13 | ** Software or, alternatively, in accordance with the terms contained in
|
---|
| 14 | ** a written agreement between you and Nokia.
|
---|
| 15 | **
|
---|
| 16 | ** GNU Lesser General Public License Usage
|
---|
| 17 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
---|
| 18 | ** General Public License version 2.1 as published by the Free Software
|
---|
| 19 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
---|
| 20 | ** packaging of this file. Please review the following information to
|
---|
| 21 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
---|
| 22 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
---|
| 23 | **
|
---|
| 24 | ** In addition, as a special exception, Nokia gives you certain additional
|
---|
| 25 | ** rights. These rights are described in the Nokia Qt LGPL Exception
|
---|
| 26 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
---|
| 27 | **
|
---|
| 28 | ** GNU General Public License Usage
|
---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
| 32 | ** packaging of this file. Please review the following information to
|
---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
---|
| 35 | **
|
---|
| 36 | ** If you have questions regarding the use of this file, please contact
|
---|
| 37 | ** Nokia at [email protected].
|
---|
| 38 | ** $QT_END_LICENSE$
|
---|
| 39 | **
|
---|
| 40 | ****************************************************************************/
|
---|
| 41 |
|
---|
| 42 | /*!
|
---|
| 43 | \page qt-conf.html
|
---|
| 44 |
|
---|
| 45 | \title Using qt.conf
|
---|
| 46 |
|
---|
| 47 | The \c qt.conf file overrides the hard-coded paths that are
|
---|
| 48 | compiled into the Qt library. These paths are accessible using the
|
---|
| 49 | QLibraryInfo class. Without \c qt.conf, the functions in
|
---|
| 50 | QLibraryInfo return these hard-coded paths; otherwise they return
|
---|
| 51 | the paths as specified in \c qt.conf.
|
---|
| 52 |
|
---|
| 53 | Without \c qt.conf, the Qt libraries will use the hard-coded paths
|
---|
| 54 | to look for plugins, translations, and so on. These paths may not
|
---|
| 55 | exist on the target system, or they may not be
|
---|
| 56 | accesssible. Because of this, you need \c qt.conf to make the Qt
|
---|
| 57 | libraries look elsewhere.
|
---|
| 58 |
|
---|
[561] | 59 | Note that on OS/2, the libraries do not use the hard-coded paths
|
---|
| 60 | by default. Instead, they look for plugins and other components in a
|
---|
| 61 | directory that contains the QtCore DLL library (or the application
|
---|
| 62 | executable if Qt is built as a static library). This behavior may
|
---|
| 63 | also be overridden using the \c qt.conf file.
|
---|
| 64 |
|
---|
[556] | 65 | QLibraryInfo will load \c qt.conf from one of the following locations:
|
---|
| 66 |
|
---|
| 67 | \list 1
|
---|
| 68 |
|
---|
| 69 | \o \c :/qt/etc/qt.conf using the resource system
|
---|
| 70 |
|
---|
| 71 | \o on Mac OS X, in the Resource directory inside the appliction
|
---|
| 72 | bundle, for example \c assistant.app/Contents/Resources/qt.conf
|
---|
| 73 |
|
---|
| 74 | \o in the directory containing the application executable, i.e.
|
---|
| 75 | QCoreApplication::applicationDirPath() + QDir::separator() + "qt.conf"
|
---|
| 76 |
|
---|
| 77 | \endlist
|
---|
| 78 |
|
---|
[561] | 79 | On OS/2, if neither of the above locations contains \c qt.conf,
|
---|
| 80 | QLibraryInfo will additionally try the following two locations:
|
---|
| 81 |
|
---|
| 82 | \list 1
|
---|
| 83 |
|
---|
| 84 | \o \c qt.conf in the directory containing the QtCore DLL library
|
---|
| 85 | (or the application executable if Qt is built as a static library)
|
---|
| 86 |
|
---|
| 87 | \o \c %ETC%\qtsys.conf
|
---|
| 88 |
|
---|
| 89 | \endlist
|
---|
| 90 |
|
---|
[556] | 91 | The \c qt.conf file is an INI text file, as described in the \l
|
---|
| 92 | {QSettings::Format}{QSettings} documentation. The file should have
|
---|
| 93 | a \c Paths group which contains the entries that correspond to
|
---|
| 94 | each value of the QLibraryInfo::LibraryLocation enum. See the
|
---|
| 95 | QLibraryInfo documentation for details on the meaning of the
|
---|
| 96 | various locations.
|
---|
| 97 |
|
---|
| 98 | \table
|
---|
| 99 |
|
---|
| 100 | \header \o Entry \o Default Value
|
---|
| 101 |
|
---|
| 102 | \row \o Prefix \o QCoreApplication::applicationDirPath()
|
---|
| 103 | \row \o Documentation \o \c doc
|
---|
| 104 | \row \o Headers \o \c include
|
---|
| 105 | \row \o Libraries \o \c lib
|
---|
| 106 | \row \o Binaries \o \c bin
|
---|
| 107 | \row \o Plugins \o \c plugins
|
---|
| 108 | \row \o Data \o \c .
|
---|
| 109 | \row \o Translations \o \c translations
|
---|
| 110 | \row \o Settings \o \c .
|
---|
| 111 | \row \o Examples \o \c .
|
---|
| 112 | \row \o Demos \o \c .
|
---|
| 113 |
|
---|
| 114 | \endtable
|
---|
| 115 |
|
---|
| 116 | Absolute paths are used as specified in the \c qt.conf file. All
|
---|
| 117 | paths are relative to the \c Prefix. On Windows and X11, the \c
|
---|
| 118 | Prefix is relative to the directory containing the application
|
---|
| 119 | executable (QCoreApplication::applicationDirPath()). On Mac OS X,
|
---|
| 120 | the \c Prefix is relative to the \c Contents in the application
|
---|
| 121 | bundle. For example, \c application.app/Contents/plugins/ is the
|
---|
| 122 | default location for loading Qt plugins. Note that the plugins
|
---|
| 123 | need to be placed in specific sub-directories under the
|
---|
| 124 | \c{plugins} directory (see \l{How to Create Qt Plugins} for
|
---|
[561] | 125 | details). On OS/2, the \c Prefix is always relative to the directory
|
---|
| 126 | where \c qt.conf or \c qtsys.conf is loaded from.
|
---|
| 127 |
|
---|
[556] | 128 | For example, a \c qt.conf file could contain the following:
|
---|
| 129 |
|
---|
| 130 | \snippet doc/src/snippets/code/doc_src_qt-conf.qdoc 0
|
---|
| 131 |
|
---|
| 132 | Subgroups of the \c Paths group may be used to specify locations
|
---|
| 133 | for specific versions of the Qt libraries. Such subgroups are of
|
---|
| 134 | the form \c Paths/x.y.z, where x is the major version of the Qt
|
---|
| 135 | libraries, y the minor, and z the patch level. The subgroup that
|
---|
| 136 | most closely matches the current Qt version is used. If no
|
---|
| 137 | subgroup matches, the \c Paths group is used as the fallback. The
|
---|
| 138 | minor and patch level values may be omitted, in which case they
|
---|
| 139 | default to zero.
|
---|
| 140 |
|
---|
| 141 | For example, given the following groups:
|
---|
| 142 |
|
---|
| 143 | \snippet doc/src/snippets/code/doc_src_qt-conf.qdoc 1
|
---|
| 144 |
|
---|
| 145 | The current version will be matched as shown:
|
---|
| 146 |
|
---|
| 147 | \list
|
---|
| 148 | \o 4.0.1 matches \c Paths/4
|
---|
| 149 | \o 4.1.5 matches \c Paths/4.1
|
---|
| 150 | \o 4.6.3 matches \c Paths/4.2.5
|
---|
| 151 | \o 5.0.0 matches \c Paths
|
---|
| 152 | \o 6.0.2 matches \c Paths/6
|
---|
| 153 | \endlist
|
---|
| 154 | */
|
---|