QT:提高QT Creator编译速度,配置预编译头Stable.h

时间:2023-03-09 08:22:02
QT:提高QT Creator编译速度,配置预编译头Stable.h

提高QT Creator编译速度,配置预编译头Stable.h

QT Creator支持预编译头提高编辑速度,网上有些教程写得不详细,走了弯路,具体实现方法如下。

(1)工程.PRO文件加入下面代码

CONFIG+=precompile_header
PRECOMPILED_HEADER=stable.h

(2)在建立头文件Stable.h,代码内容为

#ifndef STABLE_H
#define STABLE_H
#include<QtCore>
#include<QtGui>
#endif // STABLE_H