From 7caeb1d6270640c8ab5f4d8b096e4b65a8e58023 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 9 Feb 2012 10:33:49 +0100 Subject: [PATCH] Fix compilation with Qt5. - Add missing QtScript module (pulled by json in utils - Include type definitions for Q_DECLARE_METATYPE - Unconditionally include QtSvg in Qt5 Change-Id: If298dd98fb660a6ba701f1ba36ced2d2027ea3e8 Reviewed-by: Miikka Heikkinen Reviewed-by: Friedemann Kleint --- src/libs/qmljs/qmljs.pro | 1 + src/plugins/cpptools/cppcompletionassist.h | 4 ++++ src/plugins/imageviewer/imageviewer.pro | 6 +++++- src/plugins/projectexplorer/metatypedeclarations.h | 7 +++++++ src/plugins/qmljseditor/qmljseditor.pro | 1 + 5 files changed, 18 insertions(+), 1 deletion(-) diff --git a/src/libs/qmljs/qmljs.pro b/src/libs/qmljs/qmljs.pro index 0c46c7a6d03..7c93645b8c5 100644 --- a/src/libs/qmljs/qmljs.pro +++ b/src/libs/qmljs/qmljs.pro @@ -2,6 +2,7 @@ TEMPLATE = lib TARGET = QmlJS DEFINES += QMLJS_BUILD_DIR QT_CREATOR +QT +=script include(../../qtcreatorlibrary.pri) include(qmljs-lib.pri) include(../utils/utils.pri) diff --git a/src/plugins/cpptools/cppcompletionassist.h b/src/plugins/cpptools/cppcompletionassist.h index cf114abc214..527deb33863 100644 --- a/src/plugins/cpptools/cppcompletionassist.h +++ b/src/plugins/cpptools/cppcompletionassist.h @@ -37,6 +37,10 @@ #include #include #include +#if QT_VERSION >= 0x050000 +// Qt 5 requires the types to be defined for Q_DECLARE_METATYPE +# include +#endif #include #include diff --git a/src/plugins/imageviewer/imageviewer.pro b/src/plugins/imageviewer/imageviewer.pro index 40a15d89b7f..1b9005d7863 100644 --- a/src/plugins/imageviewer/imageviewer.pro +++ b/src/plugins/imageviewer/imageviewer.pro @@ -26,7 +26,11 @@ RESOURCES += \ OTHER_FILES += \ ImageViewer.mimetypes.xml -contains(QT_CONFIG, svg):QT += svg +greaterThan(QT_MAJOR_VERSION, 4) { + !isEmpty(QT.svg.name): QT += svg +} else { + contains(QT_CONFIG, svg):QT += svg +} FORMS += \ imageviewertoolbar.ui diff --git a/src/plugins/projectexplorer/metatypedeclarations.h b/src/plugins/projectexplorer/metatypedeclarations.h index 10e2088f7b7..6a7fc83d325 100644 --- a/src/plugins/projectexplorer/metatypedeclarations.h +++ b/src/plugins/projectexplorer/metatypedeclarations.h @@ -35,11 +35,18 @@ #include +#if QT_VERSION >= 0x050000 +// Qt 5 requires the types to be defined. +# include "iprojectmanager.h" +# include "session.h" +# include "project.h" +#else namespace ProjectExplorer { class IProjectManager; class SessionManager; class Project; } +#endif // QT_VERSION < 0x050000 Q_DECLARE_METATYPE(QList) Q_DECLARE_METATYPE(ProjectExplorer::SessionManager*) diff --git a/src/plugins/qmljseditor/qmljseditor.pro b/src/plugins/qmljseditor/qmljseditor.pro index 2510b41c48c..2227e1e5601 100644 --- a/src/plugins/qmljseditor/qmljseditor.pro +++ b/src/plugins/qmljseditor/qmljseditor.pro @@ -2,6 +2,7 @@ TEMPLATE = lib TARGET = QmlJSEditor include(../../qtcreatorplugin.pri) include(qmljseditor_dependencies.pri) +QT += script DEFINES += \ QMLJSEDITOR_LIBRARY \