一定要把所有问题都遇到之后才能表示自己对它熟悉
QT自定义slot的时候,程序中有Q_OBJECT宏,用codeblock 的时候会出现很多东西找不到,尽管这么问题网上提到过很多,但是没有亲身经历就是感觉很陌生。
我的解决办法:
一、添加 codeblock 的Tools两个qmake 的设置
我的两个设置是
1.
Name: qmake
Executable:C:\Qt\4.8.0\bin\qmake.exe
Parameters: -project (注意:前面有空格)
Working directory:${PROJECT_DIR}
2.
Name: qmake file
Executable:C:\Qt\4.8.0\bin\qmake.exe
Parameters:
Working directory:${PROJECT_DIR}
留空Parameters一项
二、然后新加的项目之后右键设置properties->project settings->make file 一项勾上This is a custom makefile
然后再下个标签页build targets点击debug 和release ,将output filename 路径和你创建项目的时候路径一样,否则编译之后,运行的时候会提示找不到可执行文件的
说说编译的步骤了
1. 点击tools->qmake
2. 点击tools->qmake file
3.build
这样就好了。