1. First install QT4 and use QT Creator for development demonstration
(1) Enter in Terminal:
sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig Qt4-demos Qt4-designer
which
The qt4-dev-tools includes Qt assistant,qt linguist,qt Creator
Qt4-doc This is a help document
Qt4-qtconfig qt Configuration Tool, this is installed by default good
Qt4-demos some of the official demo
Qt4-designer Visualization form setup Tool
After the installation is complete, you will see more Qt Creator, QT4 Assistant, Qt4 designer, Qt linguist, and so on under "programming with Applications"
2. Use QT Creator to create my first QT program Hello World
1. Create a new empty Qt4 project, select a different project, and select an empty QT project on the right.
2. The project is then named, followed by the wizard, and the project is built.
3. In the QT creator menu bar, select Form--show sidebar, and you can now see the project you just created.
4. Right-click the project folder, tap "Add New File", select the C + +->c++ source file here, or select the profile-----text file, just add the suffix when you name it below. cpp. The file name is not necessarily written in main.cpp, any name can be.
5 Edit the source code, click on the bottom left corner of the first green triangle button is OK.
1 #include <QApplication>
2 #include <QLabel>
4 int main (int argc, char *argv[])
5 {
6 qapplication app (argc, argv);
7 Qlabel Hello ("8 hello.show ();
9 return app.exec ();
10}
6 The results of the program operation are as follows:
The code in line seventh can also be used without UML code, directly
Qlabel Hello ("Hello qt!");
Ubuntu10.04 Install QT4 and create the first QT program