qt5 creator 上运行qt4需要注意的问题:
(1)常见1
#include <QtGui>要修改成#include <QtWidgets>
在.pro文件中添加: greaterThan(QT_MAJOR_VERSION,4): QT+= widgets
解决方法:
1.在pro文件中加入:greaterThan(QT_MAJOR_VERSION,4): QT+= widgets
2.把头文件中的#include<QtGui>改成#include<QtWidgets>
常见2 QT5.01去掉了函数QString.toAscii();用函数QString.toLatin1()代替;
为什么这么改,因为Qt4中的QtGui模块 相当于 Qt5中的 QtGui + 扩展模块Qt Widgets。
(2)改动
1.Cannot open include file: 'QtNetwork/QHttp': No such file or directory