2004-06-14 03:03:42 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2005-04-04 04:52:42 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
2004-06-14 03:03:42 +08:00
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
|
|
|
|
<!ENTITY qt-download-http "http://sunsite.rediris.es/mirror/Qt/source/qt-x11-free-&qt-version;.tar.bz2">
|
|
|
|
<!ENTITY qt-download-ftp "ftp://ftp.trolltech.com/qt/source/qt-x11-free-&qt-version;.tar.bz2">
|
2004-08-23 03:56:38 +08:00
|
|
|
<!ENTITY qt-md5sum "3e0a0c8429b0a974b39b5f535ddff01c">
|
|
|
|
<!ENTITY qt-size "14.4 MB">
|
2004-08-04 13:51:45 +08:00
|
|
|
<!ENTITY qt-buildsize "250 MB">
|
2004-08-23 03:56:38 +08:00
|
|
|
<!ENTITY qt-time "19.3 SBU (full), 13.4 SBU (sub-tools)">
|
2004-06-14 03:03:42 +08:00
|
|
|
]>
|
|
|
|
|
2003-09-27 05:14:55 +08:00
|
|
|
<sect1 id="qt" xreflabel="Qt-&qt-version;">
|
2004-08-10 12:23:09 +08:00
|
|
|
<sect1info>
|
2004-08-10 12:25:57 +08:00
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
2004-08-10 12:23:09 +08:00
|
|
|
</sect1info>
|
2004-04-14 11:02:41 +08:00
|
|
|
<?dbhtml filename="qt.html" ?>
|
2003-09-27 05:14:55 +08:00
|
|
|
<title>Qt-&qt-version;</title>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
<sect2>
|
|
|
|
<title>Introduction to <application>Qt</application></title>
|
2002-07-08 04:28:42 +08:00
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
<para>The <application>Qt</application> package contains a
|
|
|
|
<application>C++</application> <acronym>GUI</acronym> library. This is useful
|
|
|
|
for creating graphical applications or executing graphical applications that
|
|
|
|
are dynamically linked to the <application>Qt</application> library. One of the
|
2004-08-04 13:51:45 +08:00
|
|
|
major users of <application>Qt</application> is <application>KDE</application>.
|
|
|
|
</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<sect3><title>Package information</title>
|
|
|
|
<itemizedlist spacing='compact'>
|
|
|
|
<listitem><para>Download (HTTP): <ulink url="&qt-download-http;"/></para></listitem>
|
|
|
|
<listitem><para>Download (FTP): <ulink url="&qt-download-ftp;"/></para></listitem>
|
2005-01-05 23:10:50 +08:00
|
|
|
<listitem><para>Download MD5 Sum: &qt-md5sum;</para></listitem>
|
2004-05-07 15:33:03 +08:00
|
|
|
<listitem><para>Download size: &qt-size;</para></listitem>
|
2005-01-11 01:48:41 +08:00
|
|
|
<listitem><para>Estimated disk space required: &qt-buildsize;</para></listitem>
|
2004-05-07 15:33:03 +08:00
|
|
|
<listitem><para>Estimated build time: &qt-time;</para></listitem></itemizedlist>
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3><title><application>Qt</application> dependencies</title>
|
|
|
|
<sect4><title>Required</title>
|
|
|
|
<para><xref linkend="x-installing"/></para>
|
|
|
|
</sect4>
|
2004-08-23 03:56:38 +08:00
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
<sect4><title>Recommended</title>
|
2004-08-23 03:56:38 +08:00
|
|
|
<para><xref linkend="libjpeg"/> and <xref linkend="libmng"/></para>
|
2004-05-07 15:33:03 +08:00
|
|
|
</sect4>
|
|
|
|
|
|
|
|
<sect4><title>Optional</title>
|
|
|
|
<para><xref linkend="nas"/>, <xref linkend="cups"/>, <xref linkend="mysql"/>,
|
2004-08-04 13:51:45 +08:00
|
|
|
<xref linkend="postgresql"/>, <ulink url="http://sqlite.org/">SQLite</ulink>,
|
|
|
|
<ulink url="http://firebird.sourceforge.net/">Firebird</ulink>
|
2004-08-23 03:56:38 +08:00
|
|
|
and <ulink url="http://www.unixodbc.org/">unixODBC</ulink></para>
|
2004-05-07 15:33:03 +08:00
|
|
|
</sect4>
|
|
|
|
</sect3>
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Installation of <application>Qt</application></title>
|
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<para>There are several ways to install a complicated package such as
|
|
|
|
<application>Qt</application>. The files are not completely position
|
|
|
|
independent. Installation procedures execute the program
|
|
|
|
<command>pkg-config</command> to determine the location of package executables,
|
|
|
|
libraries, headers, and other files. For <application>Qt</application>,
|
|
|
|
<command>pkg-config</command> will look for the file
|
|
|
|
<filename>lib/pkgconfig/qt-mt.pc</filename> which must be modified if
|
|
|
|
relocating the package. This file is set up correctly by the build process.
|
|
|
|
</para>
|
|
|
|
|
|
|
|
<para>The default installation places the files in
|
|
|
|
<filename class='directory'>/usr/local/qt/</filename>. Many commercial
|
|
|
|
distributions place the files in the system's
|
|
|
|
<filename class='directory'>/usr</filename> hierarchy. The package can also be
|
|
|
|
installed in an arbitrary directory.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<para>This section will demonstrate two different methods.</para>
|
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<note><para>The build time for <application>Qt</application> is quite long. If
|
|
|
|
you want to save some time and don't want the tutorials and examples, change
|
|
|
|
the first make line to:</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<para><userinput><command>make sub-tools</command></userinput></para>
|
|
|
|
</note>
|
|
|
|
|
|
|
|
<sect3>
|
2004-08-04 13:51:45 +08:00
|
|
|
<title>Method 1 - Installing in the
|
|
|
|
<filename class='directory'>/usr</filename> hierarchy</title>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<para>The advantage of this method is that no updates to the
|
|
|
|
<filename>/etc/ld.so.conf</filename> or <filename>/etc/man.conf</filename>
|
|
|
|
files are required. The package files are distributed within several
|
|
|
|
subdirectories of the <filename class='directory'>/usr</filename> hierarchy.
|
|
|
|
This is the method that most commercial distributions use.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<screen><userinput><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf &&
|
|
|
|
bash
|
|
|
|
export PATH=$PWD/bin:$PATH &&
|
2004-05-23 14:09:58 +08:00
|
|
|
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &&
|
2004-05-07 15:33:03 +08:00
|
|
|
./configure -prefix /usr -docdir /usr/share/doc/qt \
|
|
|
|
-headerdir /usr/include/qt -plugindir /usr/lib/qt/plugins \
|
|
|
|
-datadir /usr/share/qt -translationdir /usr/share/qt/translations \
|
2004-10-14 13:47:41 +08:00
|
|
|
-sysconfdir /etc/qt -qt-gif -system-zlib -system-libmng \
|
|
|
|
-no-exceptions -thread -plugin-imgfmt-png \
|
|
|
|
-system-libjpeg -system-libpng &&
|
2004-05-07 15:33:03 +08:00
|
|
|
find -type f -name Makefile | xargs sed -i "s@-Wl,-rpath,/usr/lib@@g" &&
|
2004-05-08 14:47:16 +08:00
|
|
|
make &&
|
2004-05-07 15:33:03 +08:00
|
|
|
make install &&
|
|
|
|
ln -sf libqt-mt.so /usr/lib/libqt.so &&
|
2004-08-23 03:56:38 +08:00
|
|
|
rm /usr/bin/qmake &&
|
|
|
|
install -m755 -oroot -groot qmake/qmake /usr/bin &&
|
2004-05-07 15:33:03 +08:00
|
|
|
cp -r doc/man /usr/share &&
|
|
|
|
cp -r examples /usr/share/doc/qt &&
|
|
|
|
exit</command></userinput></screen>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3>
|
|
|
|
<title>Method 2 - Installing in <filename class='directory'>/opt</filename></title>
|
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<para>This is the method recommended by the <application>Qt</application>
|
|
|
|
developers. It has the advantage of keeping all the package files consolidated
|
|
|
|
in a dedicated directory hierarchy. By using this method, an update can be made
|
|
|
|
without overwriting a previous installation and users can easily revert to a
|
|
|
|
previous version by changing one symbolic link.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<para>The <application>Qt</application> developers use a default location of
|
2004-08-04 13:51:45 +08:00
|
|
|
<filename class='directory'>/usr/local/qt/</filename>, however this procedure
|
|
|
|
puts the files in <filename class='directory'>/opt/qt-&qt-version;/</filename>
|
|
|
|
and then creates a symbolic link to <filename>/opt/qt/</filename>.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<screen><userinput><command>bash
|
|
|
|
export QTDIR=$PWD &&
|
2004-05-23 14:09:58 +08:00
|
|
|
export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH &&
|
2004-05-07 15:33:03 +08:00
|
|
|
export PATH=$PWD/bin:$PATH &&
|
|
|
|
./configure -prefix /opt/qt-&qt-version; -qt-gif -system-libpng \
|
2004-06-18 10:33:33 +08:00
|
|
|
-system-libmng -system-zlib -system-libjpeg -no-exceptions \
|
|
|
|
-thread -plugin-imgfmt-png &&
|
2004-05-07 15:33:03 +08:00
|
|
|
make &&
|
|
|
|
make install &&
|
|
|
|
ln -sfn qt-&qt-version; /opt/qt &&
|
|
|
|
ln -s libqt-mt.so /opt/qt/lib/libqt.so &&
|
2004-08-23 03:56:38 +08:00
|
|
|
rm /opt/qt-&qt-version;/bin/qmake &&
|
|
|
|
install -m755 -oroot -groot qmake/qmake /opt/qt-&qt-version;/bin &&
|
2004-05-07 15:33:03 +08:00
|
|
|
cp -r doc/man /opt/qt/doc &&
|
|
|
|
cp -r examples /opt/qt/doc
|
|
|
|
exit</command></userinput></screen>
|
|
|
|
|
2004-08-23 03:56:38 +08:00
|
|
|
<note><para>If you pass the
|
|
|
|
<option>-plugin-sql-<replaceable>[driver]</replaceable></option> switch to the
|
|
|
|
<command>configure</command> command, you must also pass
|
|
|
|
<option>-I<replaceable>[/path/to/sql/headers]</replaceable></option> so
|
|
|
|
<command>make</command> can find the appropriate header files.</para></note>
|
2004-05-07 15:33:03 +08:00
|
|
|
</sect3>
|
2004-08-04 13:51:45 +08:00
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2>
|
|
|
|
<title>Command explanations</title>
|
|
|
|
|
|
|
|
<para><command>sed -i "s:cp -f:install:" mkspecs/linux-g++/qmake.conf</command>:
|
|
|
|
<command>install</command> is safer than <command>cp</command> when
|
|
|
|
libraries are in use.</para>
|
|
|
|
|
|
|
|
<para><command>bash</command>: This command enters a sub-shell to isolate
|
|
|
|
environment changes.</para>
|
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<para><command>export QTDIR=$PWD</command>: This command defines where the root
|
|
|
|
of the <application>Qt</application> directory is located.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<para><command>export LD_LIBRARY_PATH=$PWD/lib:$LD_LIBRARY_PATH</command>: This
|
|
|
|
command allows the not yet installed <application>Qt</application> libraries to
|
|
|
|
be used by the not yet installed <application>Qt</application> programs.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<para><command>export PATH=$PWD/bin:$PATH</command>: This command
|
|
|
|
allows the build process to find supporting executables.</para>
|
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<para><parameter>-qt-gif</parameter>: This switch adds support for
|
|
|
|
<filename>gif</filename> files to the libraries.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<para><parameter>-system-zlib -system-libpng</parameter>: This switch
|
2004-08-04 13:51:45 +08:00
|
|
|
forces the build instructions to use the shared libraries that are on your
|
|
|
|
system instead of creating a custom set of support libraries for these
|
2004-05-07 15:33:03 +08:00
|
|
|
functions.</para>
|
|
|
|
|
2004-10-14 13:47:41 +08:00
|
|
|
<para><parameter>-plugin-imgfmt-png</parameter>: This switch enables
|
|
|
|
<application>libpng</application> to be linked to at runtime.</para>
|
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
<para><parameter>-no-exceptions</parameter>: This switch disables
|
2004-08-04 13:51:45 +08:00
|
|
|
the exceptions coding generated by the <application>C++</application> compiler.
|
|
|
|
</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<para><parameter>-thread</parameter>: This switch adds
|
|
|
|
support for multi-threading.</para>
|
|
|
|
|
2004-06-04 11:02:45 +08:00
|
|
|
<para><command>find -type f -name Makefile | xargs sed -i
|
|
|
|
"s@-Wl,-rpath,/usr/lib@@g"</command>: This command removes hardcoded run-time
|
2004-08-04 13:51:45 +08:00
|
|
|
paths. Otherwise, <command>uic</command> always tries to run with
|
|
|
|
<application>Qt</application> libraries in <filename>/usr/lib</filename>.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<para><command>ln -s libqt-mt.so /usr/lib/libqt.so</command>: This command
|
|
|
|
allows <command>configure</command> scripts to find a working
|
|
|
|
<application>Qt</application> installation.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
2004-08-23 03:56:38 +08:00
|
|
|
<para><command>rm .../qmake; install -m755 -oroot -groot qmake/qmake .../bin</command>:
|
|
|
|
The <command>qmake</command> program is installed incorrectly by
|
|
|
|
<command>make install</command>. These two commands install the program
|
|
|
|
correctly.</para>
|
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
<para><command>cp -r doc/man /usr/share (or /opt/qt/doc)</command>: This command
|
2004-08-04 13:51:45 +08:00
|
|
|
installs the man pages which are missed by <command>make install</command>.
|
|
|
|
</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
2004-08-04 13:51:45 +08:00
|
|
|
<para><command>cp -r examples /usr/share/doc/qt (or /opt/qt/doc)</command>:
|
|
|
|
This command installs the examples which are missed by
|
|
|
|
<command>make install</command>.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<para><command>exit</command>: This command returns to the parent shell
|
|
|
|
and eliminates environment variables set earlier.</para>
|
|
|
|
|
|
|
|
</sect2>
|
2004-08-04 13:51:45 +08:00
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
<sect2>
|
|
|
|
<title>Configuring <application>Qt</application></title>
|
|
|
|
|
|
|
|
<sect3><title>Configuration Information</title>
|
2004-08-04 13:51:45 +08:00
|
|
|
<para>If you installed <application>Qt</application> using Method 2, you need
|
|
|
|
to update some configuration files so that <application>Qt</application> is
|
|
|
|
correctly found by other packages and system processes.</para>
|
|
|
|
|
|
|
|
<para>Update the <filename>/etc/ld.so.conf</filename> and
|
|
|
|
<filename>/etc/man.conf</filename> files:</para>
|
|
|
|
|
|
|
|
<screen><userinput><command>cat >> /etc/ld.so.conf << "EOF"
|
|
|
|
# Begin qt addition to /etc/ld.so.conf
|
|
|
|
|
|
|
|
/opt/qt/lib
|
|
|
|
|
|
|
|
# End qt addition
|
|
|
|
EOF
|
|
|
|
ldconfig
|
|
|
|
|
|
|
|
cat >> /etc/man.conf << "EOF"
|
|
|
|
# Begin qt addition to man.conf
|
|
|
|
|
|
|
|
MANPATH /opt/qt/doc/man
|
|
|
|
|
|
|
|
# End qt addition to man.conf
|
|
|
|
EOF</command></userinput></screen>
|
|
|
|
|
|
|
|
<para>Update the <envar>PKG_CONFIG_PATH</envar> environment variable in your
|
|
|
|
<filename>~/.bash_profile</filename> or <filename>/etc/profile</filename> with
|
|
|
|
the following:</para>
|
|
|
|
|
|
|
|
<screen><userinput>PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/qt/lib/pkgconfig</userinput></screen>
|
|
|
|
|
|
|
|
<para>The <envar>QTDIR</envar> environment variable needs to be set when
|
|
|
|
building packages that depend on <application>Qt</application>. Add the
|
|
|
|
following to the <filename>.bash_profile</filename> initialization script for
|
|
|
|
each user that builds packages using the <application>Qt</application>
|
|
|
|
libraries. Alternatively, the variable can be set in the system wide
|
|
|
|
<filename>/etc/profile</filename> file.</para>
|
|
|
|
|
|
|
|
<screen><userinput>export QTDIR=/opt/qt</userinput></screen>
|
|
|
|
|
|
|
|
<para>If you want the <application>Qt</application> executables in your shell
|
|
|
|
search path, update the <envar>PATH</envar> environment variable in your
|
|
|
|
<filename>~/.bash_profile</filename> or <filename>/etc/profile</filename> to
|
|
|
|
include <filename class='directory'>/opt/qt/bin</filename>.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
2004-06-04 11:02:45 +08:00
|
|
|
<para>As with most libraries, there is no explicit configuration to do. After
|
|
|
|
updating <filename>/etc/ld.so.conf</filename> as explained above, run
|
|
|
|
<command>/sbin/ldconfig</command> so that <command>ldd</command> can find the
|
|
|
|
shared libraries.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
2004-08-04 13:51:45 +08:00
|
|
|
|
2004-05-07 15:33:03 +08:00
|
|
|
<sect2>
|
|
|
|
<title>Contents</title>
|
|
|
|
|
|
|
|
<para>The <application>Qt</application>/<application>X11</application>
|
2004-06-04 08:38:36 +08:00
|
|
|
library contains <acronym>API</acronym>s necessary to use
|
2004-08-04 13:51:45 +08:00
|
|
|
programs based on the <application>Qt</application> <acronym>GUI</acronym>
|
|
|
|
toolkit.</para>
|
2004-05-07 15:33:03 +08:00
|
|
|
|
|
|
|
<para>The <application>Qt</application> package contains
|
|
|
|
<command>assistant</command>,
|
|
|
|
<command>designer</command>,
|
|
|
|
<command>linguist</command>,
|
|
|
|
<command>lrelease</command>,
|
|
|
|
<command>lupdate</command>,
|
|
|
|
<command>moc</command>,
|
|
|
|
<command>qm2ts</command>,
|
|
|
|
<command>qmake</command>,
|
|
|
|
<command>qtconfig</command>,
|
|
|
|
<command>uic</command>, and the
|
|
|
|
<filename class="libraryfile">libqt-mt</filename> and
|
|
|
|
<filename class="libraryfile">libqui</filename> libraries.</para>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
</sect1>
|