1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY qt-download-http "http://sunsite.rediris.es/mirror/Qt/source/qt-x11-free-&qt-version;.tar.bz2">
|
---|
8 | <!ENTITY qt-download-ftp "ftp://ftp.trolltech.com/qt/source/qt-x11-free-&qt-version;.tar.bz2">
|
---|
9 | <!ENTITY qt-md5sum "903cad618274ad84d7d13fd0027a6c3c">
|
---|
10 | <!ENTITY qt-size "14 MB">
|
---|
11 | <!ENTITY qt-buildsize "165 MB">
|
---|
12 | <!ENTITY qt-time "21.2 SBU (full), 13.4 SBU (sub-tools)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="qt" xreflabel="Qt-&qt-version;">
|
---|
16 | <?dbhtml filename="qt.html" ?>
|
---|
17 | <title>Qt-&qt-version;</title>
|
---|
18 |
|
---|
19 | <sect2>
|
---|
20 | <title>Introduction to <application>Qt</application></title>
|
---|
21 |
|
---|
22 | <para>The <application>Qt</application> package contains a
|
---|
23 | <application>C++</application> <acronym>GUI</acronym> library. This is useful
|
---|
24 | for creating graphical applications or executing graphical applications that
|
---|
25 | are dynamically linked to the <application>Qt</application> library. One of the
|
---|
26 | major users of <application>Qt</application> is <application>KDE</application>.</para>
|
---|
27 |
|
---|
28 | <sect3><title>Package information</title>
|
---|
29 | <itemizedlist spacing='compact'>
|
---|
30 | <listitem><para>Download (HTTP): <ulink url="&qt-download-http;"/></para></listitem>
|
---|
31 | <listitem><para>Download (FTP): <ulink url="&qt-download-ftp;"/></para></listitem>
|
---|
32 | <listitem><para>MD5 Sum: &qt-md5sum;</para></listitem>
|
---|
33 | <listitem><para>Download size: &qt-size;</para></listitem>
|
---|
34 | <listitem><para>Estimated Disk space required: &qt-buildsize;</para></listitem>
|
---|
35 | <listitem><para>Estimated build time: &qt-time;</para></listitem></itemizedlist>
|
---|
36 | </sect3>
|
---|
37 |
|
---|
38 | <sect3><title><application>Qt</application> dependencies</title>
|
---|
39 | <sect4><title>Required</title>
|
---|
40 | <para><xref linkend="x-installing"/></para>
|
---|
41 | </sect4>
|
---|
42 | <sect4><title>Recommended</title>
|
---|
43 | <para><xref linkend="libjpeg"/> and <xref linkend="libmng"/>.</para>
|
---|
44 | </sect4>
|
---|
45 |
|
---|
46 | <sect4><title>Optional</title>
|
---|
47 | <para><xref linkend="nas"/>, <xref linkend="cups"/>, <xref linkend="mysql"/>,
|
---|
48 | <xref linkend="postgresql"/>, <ulink url="http://firebird.sourceforge.net/">Firebird</ulink>,
|
---|
49 | and <ulink url="http://www.unixodbc.org/">unixODBC</ulink>.</para>
|
---|
50 | </sect4>
|
---|
51 | </sect3>
|
---|
52 | </sect2>
|
---|
53 |
|
---|
54 | <sect2>
|
---|
55 | <title>Installation of <application>Qt</application></title>
|
---|
56 |
|
---|
57 | <para>There are several ways to install a complicated package such as <application>Qt</application>.
|
---|
58 | The files are not completely position independent. Installation procedures execute the
|
---|
59 | program <filename>pkg-config</filename> to determine the location of package executables, libraries,
|
---|
60 | headers, and other files. For <application>Qt</application>, <filename>pkg-config</filename> will
|
---|
61 | look for the file <filename>lib/pkgconfig/qt-mt.pc</filename> which must be modified if relocating the
|
---|
62 | package. This file is set up correctly by the build process.</para>
|
---|
63 |
|
---|
64 | <para>The default installation places the files in <filename class='directory'>/usr/local/qt/</filename>.
|
---|
65 | Many commercial distributions place the files in the system's
|
---|
66 | <filename class='directory'>/usr</filename> hierarchy. The package can also be installed
|
---|
67 | in an arbitrary directory.</para>
|
---|
68 |
|
---|
69 | <para>This section will demonstrate two different methods.</para>
|
---|
70 |
|
---|
71 |
|
---|
72 | <note><para>The build time for <application>Qt</application> is quite long. If you want to
|
---|
73 | save some time and don't want the tutorials and examples, change the first make line to:</para>
|
---|
74 |
|
---|
75 | <para><userinput><command>make sub-tools</command></userinput></para>
|
---|
76 | </note>
|
---|
77 |
|
---|
78 | <sect3>
|
---|
79 | <title>Method 1 - Installing in the <filename class='directory'>/usr</filename> hierarchy</title>
|
---|
80 |
|
---|
81 | <para>The advantage of this method is that no updates to the <filename>/etc/ld.so.conf</filename>
|
---|
82 | or <filename>/etc/man.conf</filename> files are required. The package files
|
---|
83 | are distributed within several subdirectories of the <filename class='directory'>/usr</filename>
|
---|
84 | hierarchy. This is the method that most commercial distributions use.</para>
|
---|
85 |
|
---|
86 |
|
---|
87 | <screen><userinput><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf &&
|
---|
88 | bash
|
---|
89 | export PATH=$PWD/bin:$PATH &&
|
---|
90 | export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &&
|
---|
91 | ./configure -prefix /usr -docdir /usr/share/doc/qt \
|
---|
92 | -headerdir /usr/include/qt -plugindir /usr/lib/qt/plugins \
|
---|
93 | -datadir /usr/share/qt -translationdir /usr/share/qt/translations \
|
---|
94 | -sysconfdir /etc/qt -qt-gif -system-zlib \
|
---|
95 | -no-exceptions -thread -plugin-imgfmt-png -system-libpng &&
|
---|
96 | find -type f -name Makefile | xargs sed -i "s@-Wl,-rpath,/usr/lib@@g" &&
|
---|
97 | make &&
|
---|
98 | make install &&
|
---|
99 | ln -sf libqt-mt.so /usr/lib/libqt.so &&
|
---|
100 | cp -r doc/man /usr/share &&
|
---|
101 | cp -r examples /usr/share/doc/qt &&
|
---|
102 | exit</command></userinput></screen>
|
---|
103 |
|
---|
104 | </sect3>
|
---|
105 |
|
---|
106 | <sect3>
|
---|
107 | <title>Method 2 - Installing in <filename class='directory'>/opt</filename></title>
|
---|
108 |
|
---|
109 | <para>This is the method recommended by the <application>Qt</application> developers. It
|
---|
110 | has the advantage of keeping all the package files consolidated in a dedicated directory
|
---|
111 | hierarchy. By using this method, an update can be made without overwriting a previous
|
---|
112 | installation and users can easily revert to a previous version by changing one symbolic
|
---|
113 | link.</para>
|
---|
114 |
|
---|
115 | <para>The <application>Qt</application> developers use a default location of
|
---|
116 | <filename class='directory'>/usr/local/qt/</filename>, however this procedure puts the files
|
---|
117 | in <filename class='directory'>/opt/qt-&qt-version;/</filename> and then creates a
|
---|
118 | symbolic link to <filename>/opt/qt/</filename>.</para>
|
---|
119 |
|
---|
120 |
|
---|
121 | <screen><userinput><command>bash
|
---|
122 | export QTDIR=$PWD &&
|
---|
123 | export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &&
|
---|
124 | export PATH=$PWD/bin:$PATH &&
|
---|
125 | ./configure -prefix /opt/qt-&qt-version; -qt-gif -system-libpng \
|
---|
126 | -system-libmng -system-zlib -system-libjpeg -no-exceptions \
|
---|
127 | -thread -plugin-imgfmt-png &&
|
---|
128 | make &&
|
---|
129 | make install &&
|
---|
130 | ln -sfn qt-&qt-version; /opt/qt &&
|
---|
131 | ln -s libqt-mt.so /opt/qt/lib/libqt.so &&
|
---|
132 | cp -r doc/man /opt/qt/doc &&
|
---|
133 | cp -r examples /opt/qt/doc
|
---|
134 | exit</command></userinput></screen>
|
---|
135 |
|
---|
136 | <sect4>
|
---|
137 | <title>Configuration</title>
|
---|
138 |
|
---|
139 | <para>For Method 2 only, update the <filename>/etc/ld.so.conf</filename> and
|
---|
140 | <filename>/etc/man.conf</filename> files.</para>
|
---|
141 |
|
---|
142 |
|
---|
143 | <screen><userinput><command>cat >> /etc/ld.so.conf << "EOF"
|
---|
144 | # Begin qt addition to /etc/ld.so.conf
|
---|
145 |
|
---|
146 | /opt/qt/lib
|
---|
147 |
|
---|
148 | # End qt addition
|
---|
149 | EOF
|
---|
150 | ldconfig
|
---|
151 |
|
---|
152 | cat >> /etc/man.conf << "EOF"
|
---|
153 | # Begin qt addition to man.conf
|
---|
154 |
|
---|
155 | MANPATH /opt/qt/doc/man
|
---|
156 |
|
---|
157 | # End qt addition to man.conf
|
---|
158 | EOF</command></userinput></screen>
|
---|
159 |
|
---|
160 | <para>Also, the <envar>QTDIR</envar> environment variable needs to be set when
|
---|
161 | building packages that depend on Qt. Add the following to the
|
---|
162 | <filename>.bash_profile</filename> initialization script for each user that
|
---|
163 | builds packages using the <application>Qt</application> libraries.
|
---|
164 | Alternatively, the variable can be set in the system wide
|
---|
165 | <filename>/etc/profile</filename> file.</para>
|
---|
166 |
|
---|
167 | <screen><userinput>export QTDIR=/opt/qt</userinput></screen>
|
---|
168 |
|
---|
169 | </sect4>
|
---|
170 | </sect3>
|
---|
171 | </sect2>
|
---|
172 |
|
---|
173 | <sect2>
|
---|
174 | <title>Command explanations</title>
|
---|
175 |
|
---|
176 | <para><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf</command>:
|
---|
177 | <command>install</command> is safer than <command>cp</command> when
|
---|
178 | libraries are in use.</para>
|
---|
179 |
|
---|
180 | <para><command>bash</command>: This command enters a sub-shell to isolate
|
---|
181 | environment changes.</para>
|
---|
182 |
|
---|
183 | <para><command>export QTDIR=$PWD</command>: This command
|
---|
184 | defines where the root of the Qt directory is located.</para>
|
---|
185 |
|
---|
186 | <para><command>export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH</command>: This command
|
---|
187 | allows the not yet installed qt libraries to be used by the not yet installed qt programs.</para>
|
---|
188 |
|
---|
189 | <para><command>export PATH=$PWD/bin:$PATH</command>: This command
|
---|
190 | allows the build process to find supporting executables.</para>
|
---|
191 |
|
---|
192 | <para><parameter>-qt-gif</parameter>: This switch adds support for gif
|
---|
193 | files to the libraries.</para>
|
---|
194 |
|
---|
195 | <para><parameter>-system-zlib -system-libpng</parameter>: This switch
|
---|
196 | forces the build instructions to use the shared libraries that are on your system
|
---|
197 | instead of creating a custom set of support libraries for these
|
---|
198 | functions.</para>
|
---|
199 |
|
---|
200 | <para><parameter>-no-exceptions</parameter>: This switch disables
|
---|
201 | the exceptions coding generated by the <application>C++</application> compiler.</para>
|
---|
202 |
|
---|
203 | <para><parameter>-thread</parameter>: This switch adds
|
---|
204 | support for multi-threading.</para>
|
---|
205 |
|
---|
206 | <para><command>find -type f -name Makefile | xargs sed -i
|
---|
207 | "s@-Wl,-rpath,/usr/lib@@g"</command>: This command removes hardcoded run-time
|
---|
208 | paths. Otherwise, <command>uic</command> always tries to run with Qt libraries
|
---|
209 | in <filename>/usr/lib</filename>.</para>
|
---|
210 |
|
---|
211 | <para><command>ln -s libqt-mt.so /usr/lib/libqt.so</command>: This
|
---|
212 | command allows configure scripts
|
---|
213 | to find a working <application>Qt</application> installation.</para>
|
---|
214 |
|
---|
215 | <para><command>cp -r doc/man /usr/share (or /opt/qt/doc)</command>: This command
|
---|
216 | installs the man pages which are missed by <command>make install</command>.</para>
|
---|
217 |
|
---|
218 | <para><command>cp -r examples /usr/share/doc/qt (or /opt/qt/doc)</command>: This command
|
---|
219 | installs the examples which are missed by <command>make install</command>.</para>
|
---|
220 |
|
---|
221 | <para><command>exit</command>: This command returns to the parent shell
|
---|
222 | and eliminates environment variables set earlier.</para>
|
---|
223 |
|
---|
224 | </sect2>
|
---|
225 | <sect2>
|
---|
226 | <title>Configuring <application>Qt</application></title>
|
---|
227 |
|
---|
228 | <sect3><title>Configuration Information</title>
|
---|
229 |
|
---|
230 | <para>As with most libraries, there is no explicit configuration to do. After
|
---|
231 | updating <filename>/etc/ld.so.conf</filename> as explained above, run
|
---|
232 | <command>/sbin/ldconfig</command> so that <command>ldd</command> can find the
|
---|
233 | shared libraries.</para>
|
---|
234 |
|
---|
235 | </sect3>
|
---|
236 |
|
---|
237 | </sect2>
|
---|
238 | <sect2>
|
---|
239 | <title>Contents</title>
|
---|
240 |
|
---|
241 | <para>The <application>Qt</application>/<application>X11</application>
|
---|
242 | library contains <acronym>API</acronym>s necessary to use
|
---|
243 | programs based on the Qt <acronym>GUI</acronym> toolkit.</para>
|
---|
244 |
|
---|
245 | <para>The <application>Qt</application> package contains
|
---|
246 | <command>assistant</command>,
|
---|
247 | <command>designer</command>,
|
---|
248 | <command>linguist</command>,
|
---|
249 | <command>lrelease</command>,
|
---|
250 | <command>lupdate</command>,
|
---|
251 | <command>moc</command>,
|
---|
252 | <command>qm2ts</command>,
|
---|
253 | <command>qmake</command>,
|
---|
254 | <command>qtconfig</command>,
|
---|
255 | <command>uic</command>, and the
|
---|
256 | <filename class="libraryfile">libqt-mt</filename> and
|
---|
257 | <filename class="libraryfile">libqui</filename> libraries.</para>
|
---|
258 |
|
---|
259 | </sect2>
|
---|
260 | </sect1>
|
---|