1. Qt4 installation process $ sudoapt-getinstalllibqt4-devlibqt4-dbglibqt4-guilibqt4-sqlqt4-dev-toolsqt4-docqt4-designerqt4-qtconfig2. Pay attention to these two settings when creating a Qt4 project: Qt 'slocation:/usr "Debug/Release" op
1. Qt4 Installation Process
$ Sudo apt-get install libqt4-dev libqt4-dbg libqt4-gui libqt4-sql qt4-dev-tools qt4-doc qt4-designer
2. Pay attention to these two settings when creating a Qt4 project:
Qt's location:/usr
"Debug/Release" options Output dir.: And Objects output dir.: Set to null, that is, the project root directory.
3. When you need to use the Q_OBJECT macro, an error is reported when you Build the macro directly. We need to use Qmake:
Click [Tools]-> [Configure tools...] to add two new Tools:
1)
Name: Create Qt Project File
Executable:/usr/share/qt4/bin/qmake <-- the absolute path of qmake on the local machine
Parameters:-project
Working directory: $ {PROJECT_DIR}
Launching options select Launch tool hidden with standard output redirected
Note: The command line window will not pop up.
Click OK.
2)
Name: Create Qt Makefile
Executable:/usr/share/qt4/bin/qmake <-- the absolute path of qmake on the local machine
Parameters:-makefile
Working directory: $ {PROJECT_DIR}
Launching options select Launch tool hidden with standard output redirected
Note: The command line window will not pop up.
Click OK.
4. Click [Project]-> [Properties...]-> [Project settings],
Check "This is a custom Makefile" to use the custom Makefile.
5. Click the "Build targets" option page above,
Change the "Type:" drop-down list box to "GUI application ".
6. Click [Project]-> [Build options...]-> "Make" commands option page to delete all $ targets.
After the preceding settings are complete, use the Create Qt Project File and Create Qt Makefile tools before compilation,
You can build it again.
Code: Blocks: Click here
Code: Blocks: Click here
For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2