On Linux you need to do the following:
1. export QTDIR=/opt/qt/qt-4
2. export PATH=.:$PATH:$QTDIR/bin
3, export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$QTDIR/lib:/usr/lib:/usr/local/lib
Assuming that you installed qt4 in /opt/qt/qt-4. You can save them in your .bashrc file.