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