Looking for: Demonstrate how to quickly develop QT applications.
1. Installing the QT Integration environment under Ubuntu
sudo apt-get install qt4-dev-tools qt4-doc qt4-qtconfig Qt4-demos Qt4-designer
2. Write a simple QT program
First: Create an app folder Qtapp and go to the folder
CD ~
mkdir Qtapp
CD Qtapp
To write a program:
Gedit Test1.cpp
The contents are as follows:
#include <QApplication> #include <qlabel>int main (int argc, char *argv[]) { qapplication app (argc, argv) ; Qlabel *label = new Qlabel ("Hello qt!"); Label->show ();
3. Build a platform-agnostic project file
~/qtapp$ qmake-project
Got a project file named: Qtapp.pro
4. Generate the Makefile file
~/qtapp$ qmake Hello.pro
Get makefile File
5. Generate the target file
~/qtapp$ Make
The display information is:
g++-c-m64-pipe-o2-wall-w-d_reentrant-dqt_no_debug-dqt_gui_lib-dqt_core_lib-dqt_shared-i/usr/share/qt4/mkspecs/ Linux-g++-64-i.-i/usr/include/qt4/qtcore-i/usr/include/qt4/qtgui-i/usr/include/qt4-i.-O test1.o test1.cpp
g++-m64-wl,-o1-o Qtapp Test1.o-l/usr/lib/x86_64-linux-gnu-lqtgui-lqtcore-lpthread
Get the Qtapp executable file
6. Implementation of the target file
./qtapp
Visible program window (look carefully on the screen, because it is relatively small)
Rapid development of QT applications under Ubuntu14.04