gpt4 book ai didi

windows - QDialog 不是这样的文件或目录 - Qt Windows

转载 作者:可可西里 更新时间:2023-11-01 12:44:32 28 4
gpt4 key购买 nike

我刚刚安装了基于Qt 5.0 的Qt Creator 2.6.1。

我试图打开一个在 4.8 上创建的项目,但我无法编译它。它一直向我显示“不是这样的文件或目录”的错误。

error: C1083: Cannot open include file: 'QtGui/QApplication': No such file or directory 

error: C1083: Cannot open include file: 'QDialog': No such file or directory

error: C1083: Cannot open include file: 'QMainWindow': No such file or directory

error: C1083: Cannot open include file: 'QWidget': No such file or directory

还有更多。

我已将 qmake.exe 路径添加到 PATH...我还需要做其他事情吗?

最佳答案

阅读从 Qt4Qt5 的转换指南。 Link1 Link2 Link3

One of the major internal infrastructural changes in Qt 5 compared to Qt 4 is the splitting of widgets from the QtGui module into a new QtWidgets module. This obviously will require buildsystem changes at least, but also causes the need for downstreams to add includes for headers which were not needed before, as those includes were removed from headers which now remain in the QtGui module.

Another includes-related issue in porting from Qt 4 to Qt 5 is dealing with includes for classes which have moved to the QtWidgets module. Whereas Qt 4 based code might use

#include <QtGui/QWidget>
This must be updated to either

#include <QtWidgets/QWidget>
Or more portably (Which works in Qt 4 and Qt 5):

#include <QWidget>

关于windows - QDialog 不是这样的文件或目录 - Qt Windows,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14260475/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com