项目qt4迁移代码到qt5

并需要在pro文件里加上


greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

 并将引用的#include <QtGui>替换为#include <QtWidgets>

C++ GUI Programming with Qt 4上一段代码,编译不能通过:

在Qt官网wiki找到了答案:http://qt-project.org/wiki/Transition_from_Qt_4.x_to_Qt5

Change all instances of

to

猜你喜欢

转载自www.cnblogs.com/feiyufu/p/9999727.html