1. On the official website (http://qt.nokia.com/downloads/downloads) Download the SDK, the default recommended online installation.
Download get file Qt_sdk_lin32_online_v1_1_3_en.run
Run directly (./file name)
Select the installation directory, where I select My home directory (/home/username)
2. After installation, there is a qtsdk folder in the home directory, the folder is a QT library 4.7.4, Qt Creator 2.3.0, Qt Simulator for Symbian/meego, Qt Mobility 1.2.0, Remote All development tools such as compilers
3. Install to this end, set environment variables below. The bin directory of the integrated QTSDK is difficult to find (/home/user name/qtsdk/desktop/qt/474/gcc/bin)
sudo vi/etc/profile
In Export path= ... Continue adding content later, note separated by colons (:/above directory)
Make the configuration file effective immediately: Source/etc/profile
4. You can now use QT to write our first program.
5. Create a new QT directory under the user directory, vi hello.cpp
#include <QApplication>
#include <QLabel>
int main (int argc, int *argv[])
{
qapplication App (argc, argv);
Qlabel *label = new Qlabel ("Hello qt!");
Label->show ();
return app.exec ();
}
5. Save exit, enter the following command to generate a platform-independent project file Hello.pro:
Qmake-project
6. Then, enter the following command to generate a platform-related makefile file from this project file:
Qmake Hello.pro
7. Type the make command to build the program.
Make
8. Run the program
./hello
You can see the program run result diagram: