glfs/archive/setqt.xml
Xi Ruoyao 45ab6c70c2
more SVN prop clean up
Remove "$LastChanged$" everywhere, and also some unused $Date$
2021-04-20 19:12:02 +08:00

35 lines
1.5 KiB
XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE note PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % general-entities SYSTEM "../general.ent">
%general-entities;
]>
<sect3>
<title>Choosing Qt Program Versions</title>
<para>If you install both Qt4 and Qt5, you can use some simple
scripts to select the currently active set of Qt programs. As the
<systemitem class="username">root</systemitem> user, create
the following scripts:</para>
<screen role="root"><userinput>cat &gt; /usr/bin/setqt4 &lt;&lt; 'EOF'
<literal>if [ "x$QT5DIR" != "x/usr" ] &amp;&amp; [ "x$QT5DIR" != "x" ]; then pathremove $QT5DIR/bin; fi
if [ "x$QT4DIR" != "x/usr" ]; then pathprepend $QT4DIR/bin; fi
echo $PATH</literal>
EOF</userinput></screen>
<screen role="root"><userinput>cat &gt; /usr/bin/setqt5 &lt;&lt; 'EOF'
<literal>if [ "x$QT4DIR" != "x/usr" ] &amp;&amp; [ "x$QT4DIR" != "x" ]; then pathremove $QT4DIR/bin; fi
if [ "x$QT5DIR" != "x/usr" ]; then pathprepend $QT5DIR/bin; fi
echo $PATH</literal>
EOF</userinput></screen>
<para>You should now be able to use the appropriate Qt version by running
<command>source setqt4</command> or <command>source setqt5</command> as
desired. (Setting the PATH wont work in a subshell.) Another technique that
can be used is to create appropriate alias additions to your ~/.bashrc like
<command>alias setqt4='source setqt4'</command>.</para>
</sect3>