Qt Creator 没有正确解析我的项目中的包含文件,并在 IDE 中给出很多错误,包括main.cpp:14:5: error: unknown type name 'QApplication'. 然而,我的项目编译得很好。我厌倦了所有这些假定的错误,并且想知道是否有任何方法可以解决此问题。
我的 .pro 文件如下所示:
QT += core gui widgets
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS
# You can also make your …Run Code Online (Sandbox Code Playgroud)