1. Install the Qt Integration Environment sudoapt-getinstallqt4-dev-toolsqt4-docqt4-qtconfigqt4-demosqt4-designer2 In Ubuntu. Compile a simple Qt program to generate a simple window # include & lt; QApplication & gt; # include &
1. Install the Qt Integration Environment in Ubuntu
Sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig qt4-demos
2. Compile a simple Qt Program
Generate a simple window
# Include
# Include
IntMain ( IntArgc, Char* Argv [])
{
QApplication app (argc, argv );
QLabel * label = NewQLabel ( " Hello Qt! ");
Label-> show ();
ReturnApp.exe c ();
}
3. Generate a project file irrelevant to the platform
Www.linuxidc.com @ ubuntu :~ /MyTrain/Qt/Basic/hello $ qmake-project
4. Generate the makefile file
Www.linuxidc.com @ ubuntu :~ /MyTrain/Qt/Basic/hello $ qmake hello. pro
5. Generate the target file
Www.linuxidc.com @ ubuntu :~ /MyTrain/Qt/Basic/hello $ make
6. Execute the target file
Www.linuxidc.com @ ubuntu :~ /MyTrain/Qt/Basic/hello $./hello
7. Running result