c++ - 从 Qt 4.x (Ubuntu Linux) 迁移到 Qt 5.1 (Windows 7)

标签 c++ linux windows qt qt-creator

我去年在Ubuntu Linux平台上用Qt 4.x中的Qt Creator做了一个程序。现在我不使用 linux,而是使用 Windows 7。我再次需要我去年制作的程序。我在 Windows 7 平台上下载并安装了 Qt Creator。它随 Qt 5.1 一起提供。我尝试重建它。我收到以下消息。我该怎么办?

C1083: 无法打开包含文件: 'QtGui/QApplication': 没有那个文件或目录
C1083: 无法打开包含文件: 'QDialog': 没有那个文件或目录

谢谢

最佳答案

在 Qt5 中,QApplication 不再是 QtGui 模块的一部分,它现在位于 QtWidgets 中。在你的#include指令使用 <QtWidgets/QApplication> ,这同样适用于QDialog

关于c++ - 从 Qt 4.x (Ubuntu Linux) 迁移到 Qt 5.1 (Windows 7),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17627870/

相关文章:

c++ - 如何在 Linux 中的 GDB/Nemiver 中显示 C++ STL 容器

c - 使用 JNI 截取 Windows 屏幕截图

c++ - 理解为什么编译时 bool 代数不起作用

linux - 在远程 ubuntu 机器上执行 bash 命令时出错 "no tty present and no askpass program specified"

c++ - 当操作数类型为 short 时编译模板标量 vector 加法运算符失败

Java 性能 Windows 与 Linux

windows - 编写 Windows NT 子系统

Node.js fs 模块和 windows 路径

c++ - Visual C++ 错误 LNK1120 编译

c++ - 在非静态成员函数中使用 C++11 lambda 并调用同一类的静态成员函数