source: trunk/doc/src/qt-conf.qdoc@ 109

Last change on this file since 109 was 2, checked in by Dmitry A. Kuminov, 16 years ago

Initially imported qt-all-opensource-src-4.5.1 from Trolltech.

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