LoginSignup
7
7

More than 5 years have passed since last update.

Qt4のソースをQt5に移管するときの修正点

Posted at

・プロジェクトファイル
Qt4
#QT += core gui
Qt5
QT += core gui network webkitwidgets
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

・QtGui/QApplication
//#include <QtGui/QApplication> // Qt4
#include <QtWidgets/QApplication> // Qt5

・QGraphicsView
//#include <QGraphicsView> // Qt4
#include <QtWidgets/QGraphicsView> // Qt5

・QDialog
//#include <QDialog> // Qt4
#include <QtWidgets/QDialog> // Qt5

・QGraphicsRectItem
//#include <QGraphicsRectItem> // Qt4
#include <QtWidgets/QGraphicsRectItem> // Qt5

・QWidget
//#include <QWidget> // Qt4
#include <QtWidgets/QtWidgets> // Qt5

・QMouseEvent::posF
//drawRectTo(event->posF()); // Qt4
drawRectTo(event->localPos()); // Qt5

・アプリ配布
Qt5でWindowsアプリを配布するときはexeと同じ場所に
platformsフォルダ
 ├ qminimal.dll
 └ qwindows.dll

参考1:http://qiita.com/yasumodev/items/b304966f6999fbea920d
参考2:http://www.kohgakusha.co.jp/support/qt/

7
7
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
7
7