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