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

Last change on this file since 846 was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

  • Property svn:eol-style set to native
File size: 5.6 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 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:FDL$
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 a
14** written agreement between you and Nokia.
15**
16** GNU Free Documentation License
17** Alternatively, this file may be used under the terms of the GNU Free
18** Documentation License version 1.3 as published by the Free Software
19** Foundation and appearing in the file included in the packaging of this
20** file.
21**
22** If you have questions regarding the use of this file, please contact
23** Nokia at [email protected].
24** $QT_END_LICENSE$
25**
26****************************************************************************/
27
28/*!
29 \page qt-conf.html
30
31 \title Using qt.conf
32
33 The \c qt.conf file overrides the hard-coded paths that are
34 compiled into the Qt library. These paths are accessible using the
35 QLibraryInfo class. Without \c qt.conf, the functions in
36 QLibraryInfo return these hard-coded paths; otherwise they return
37 the paths as specified in \c qt.conf.
38
39 Without \c qt.conf, the Qt libraries will use the hard-coded paths
40 to look for plugins, translations, and so on. These paths may not
41 exist on the target system, or they may not be
42 accesssible. Because of this, you need \c qt.conf to make the Qt
43 libraries look elsewhere.
44
45 Note that on OS/2, the libraries do not use the hard-coded paths
46 by default. Instead, they look for plugins and other components in a
47 directory that contains the QtCore DLL library (or the application
48 executable if Qt is built as a static library). This behavior may
49 also be overridden using the \c qt.conf file.
50
51 QLibraryInfo will load \c qt.conf from one of the following locations:
52
53 \list 1
54
55 \o \c :/qt/etc/qt.conf using the resource system
56
57 \o on Mac OS X, in the Resource directory inside the appliction
58 bundle, for example \c assistant.app/Contents/Resources/qt.conf
59
60 \o in the directory containing the application executable, i.e.
61 QCoreApplication::applicationDirPath() + QDir::separator() + "qt.conf"
62
63 \endlist
64
65 On OS/2, if neither of the above locations contains \c qt.conf,
66 QLibraryInfo will additionally try the following locations, in the
67 given order:
68
69 \list 1
70
71 \o \c qt.conf in the directory containing the QtCore DLL library
72 (or the application executable if Qt is built as a static library)
73
74 \o hard-coded system-wide \c .conf file (if set by the given build
75 of the Qt library)
76
77 \o \c %ETC%\qt.conf
78
79 \endlist
80
81 The \c qt.conf file is an INI text file, as described in the \l
82 {QSettings::Format}{QSettings} documentation. The file should have
83 a \c Paths group which contains the entries that correspond to
84 each value of the QLibraryInfo::LibraryLocation enum. See the
85 QLibraryInfo documentation for details on the meaning of the
86 various locations.
87
88 \table
89
90 \header \o Entry \o Default Value
91
92 \row \o Prefix \o QCoreApplication::applicationDirPath()
93 \row \o Documentation \o \c doc
94 \row \o Headers \o \c include
95 \row \o Libraries \o \c lib
96 \row \o Binaries \o \c bin
97 \row \o Plugins \o \c plugins
98 \row \o Imports \o \c imports
99 \row \o Data \o \c .
100 \row \o Translations \o \c translations
101 \row \o Settings \o \c .
102 \row \o Examples \o \c .
103 \row \o Demos \o \c .
104
105 \endtable
106
107 Absolute paths are used as specified in the \c qt.conf file. All
108 paths are relative to the \c Prefix. On Windows and X11, the \c
109 Prefix is relative to the directory containing the application
110 executable (QCoreApplication::applicationDirPath()). On Mac OS X,
111 the \c Prefix is relative to the \c Contents in the application
112 bundle. For example, \c application.app/Contents/plugins/ is the
113 default location for loading Qt plugins. Note that the plugins
114 need to be placed in specific sub-directories under the
115 \c{plugins} directory (see \l{How to Create Qt Plugins} for
116 details). On OS/2, the \c Prefix is always relative to the directory
117 where \c qt.conf or \c qtsys.conf is loaded from.
118
119 For example, a \c qt.conf file could contain the following:
120
121 \snippet doc/src/snippets/code/doc_src_qt-conf.qdoc 0
122
123 Subgroups of the \c Paths group may be used to specify locations
124 for specific versions of the Qt libraries. Such subgroups are of
125 the form \c Paths/x.y.z, where x is the major version of the Qt
126 libraries, y the minor, and z the patch level. The subgroup that
127 most closely matches the current Qt version is used. If no
128 subgroup matches, the \c Paths group is used as the fallback. The
129 minor and patch level values may be omitted, in which case they
130 default to zero.
131
132 For example, given the following groups:
133
134 \snippet doc/src/snippets/code/doc_src_qt-conf.qdoc 1
135
136 The current version will be matched as shown:
137
138 \list
139 \o 4.0.1 matches \c Paths/4
140 \o 4.1.5 matches \c Paths/4.1
141 \o 4.6.3 matches \c Paths/4.2.5 (because 4.2.5 is the latest version with the same major version number)
142 \o 5.0.0 matches \c Paths
143 \o 6.0.2 matches \c Paths/6
144 \endlist
145*/
Note: See TracBrowser for help on using the repository browser.