Bonsoir,
Je poursuit la migration de mon application vers Qt 5.5 depuis Qt 4.7.
Je rencontre désormais des dizaines de fois lors de la compilation ce type d'erreur :
Dans le fichier discovery.cpp voici les lignes concernées :
Dans mon .pro j'ai bien ajouté : QT += widgets
J'ai fais d'autres "essais". Si par exemple je remplace par :
J'obtiens alors d'autres erreurs :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8 #include <QtGlobal> #if QT_VERSION >= 0x050000 #include <QObject> #include <QtWidgets/QWidget> #include <QtWidgets/QDialog> #else #include <QtGui> #endif
In file included from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets/QDialog:1:0, from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtGui/qwindowdefs.h:40, from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets/qwidget.h:37, from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets/QWidget:1, from ../discovery.cpp:14: C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets/qdialog.h:45:41: error: invalid use of incomplete type 'class QWidget' class Q_WIDGETS_EXPORT QDialog : public QWidget In file included from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtCore/qobject.h:48:0, from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtCore/QObject:1, from ../discovery.cpp:13: C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtCore/qmetatype.h:1314:7: error: forward declaration of 'class QWidget' class QWidget; In file included from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets/QDialog:1:0, from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtGui/qwindowdefs.h:40, from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets/qwidget.h:37, from C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets/QWidget:1, from ../discovery.cpp:14: C:/Qt/Qt5.5.0/5.5/mingw492_32/include/QtWidgets/qdialog.h:98:24: error: 'QKeyEvent' has not been declared void keyPressEvent(QKeyEvent *); ^
Merci par avance.
Partager