解決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

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