0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the documentation of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
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 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
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 |
|
|
59 |
QLibraryInfo will load \c qt.conf from one of the following locations:
|
|
60 |
|
|
61 |
\list 1
|
|
62 |
|
|
63 |
\o \c :/qt/etc/qt.conf using the resource system
|
|
64 |
|
|
65 |
\o on Mac OS X, in the Resource directory inside the appliction
|
|
66 |
bundle, for example \c assistant.app/Contents/Resources/qt.conf
|
|
67 |
|
|
68 |
\o in the directory containing the application executable, i.e.
|
|
69 |
QCoreApplication::applicationDirPath() + QDir::separator() + "qt.conf"
|
|
70 |
|
|
71 |
\endlist
|
|
72 |
|
|
73 |
The \c qt.conf file is an INI text file, as described in the \l
|
|
74 |
{QSettings::Format}{QSettings} documentation. The file should have
|
|
75 |
a \c Paths group which contains the entries that correspond to
|
|
76 |
each value of the QLibraryInfo::LibraryLocation enum. See the
|
|
77 |
QLibraryInfo documentation for details on the meaning of the
|
|
78 |
various locations.
|
|
79 |
|
|
80 |
\table
|
|
81 |
|
|
82 |
\header \o Entry \o Default Value
|
|
83 |
|
|
84 |
\row \o Prefix \o QCoreApplication::applicationDirPath()
|
|
85 |
\row \o Documentation \o \c doc
|
|
86 |
\row \o Headers \o \c include
|
|
87 |
\row \o Libraries \o \c lib
|
|
88 |
\row \o Binaries \o \c bin
|
|
89 |
\row \o Plugins \o \c plugins
|
|
90 |
\row \o Data \o \c .
|
|
91 |
\row \o Translations \o \c translations
|
|
92 |
\row \o Settings \o \c .
|
|
93 |
\row \o Examples \o \c .
|
|
94 |
\row \o Demos \o \c .
|
|
95 |
|
|
96 |
\endtable
|
|
97 |
|
|
98 |
Absolute paths are used as specified in the \c qt.conf file. All
|
|
99 |
paths are relative to the \c Prefix. On Windows and X11, the \c
|
|
100 |
Prefix is relative to the directory containing the application
|
|
101 |
executable (QCoreApplication::applicationDirPath()). On Mac OS X,
|
|
102 |
the \c Prefix is relative to the \c Contents in the application
|
|
103 |
bundle. For example, \c application.app/Contents/plugins/ is the
|
|
104 |
default location for loading Qt plugins. Note that the plugins
|
|
105 |
need to be placed in specific sub-directories under the
|
|
106 |
\c{plugins} directory (see \l{How to Create Qt Plugins} for
|
|
107 |
details).
|
|
108 |
|
|
109 |
For example, a \c qt.conf file could contain the following:
|
|
110 |
|
|
111 |
\snippet doc/src/snippets/code/doc_src_qt-conf.qdoc 0
|
|
112 |
|
|
113 |
Subgroups of the \c Paths group may be used to specify locations
|
|
114 |
for specific versions of the Qt libraries. Such subgroups are of
|
|
115 |
the form \c Paths/x.y.z, where x is the major version of the Qt
|
|
116 |
libraries, y the minor, and z the patch level. The subgroup that
|
|
117 |
most closely matches the current Qt version is used. If no
|
|
118 |
subgroup matches, the \c Paths group is used as the fallback. The
|
|
119 |
minor and patch level values may be omitted, in which case they
|
|
120 |
default to zero.
|
|
121 |
|
|
122 |
For example, given the following groups:
|
|
123 |
|
|
124 |
\snippet doc/src/snippets/code/doc_src_qt-conf.qdoc 1
|
|
125 |
|
|
126 |
The current version will be matched as shown:
|
|
127 |
|
|
128 |
\list
|
|
129 |
\o 4.0.1 matches \c Paths/4
|
|
130 |
\o 4.1.5 matches \c Paths/4.1
|
|
131 |
\o 4.6.3 matches \c Paths/4.2.5
|
|
132 |
\o 5.0.0 matches \c Paths
|
|
133 |
\o 6.0.2 matches \c Paths/6
|
|
134 |
\endlist
|
|
135 |
*/
|