加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Windows > 正文

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

发布时间:2020-12-13 22:48:37 所属栏目:Windows 来源:网络整理
导读:我刚刚安装了基于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 o
我刚刚安装了基于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 …我还需要做其他事吗?

阅读从Qt4到Qt5的过渡指南. 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>

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读