解决QT中错误error: QApplication: No such file or directory #include

解决QT4到QT5中出现错误error: QApplication: No such file or directory #include “QApplication”

在QT从QT4到QT5,移植的过程中,编译会遇到这样的错误,主要是QT5中默认没有加载这些组建

解决方法:
在工程*.pro文件中添加:
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章