path: root/mkspecs
diff options
authorKent Hansen <>2011-11-25 12:13:16 +0100
committerQt by Nokia <>2011-12-02 15:59:58 +0100
commit613183ff8c101fe544814259197d897b3540bc85 (patch)
tree9bf710ba602c24b739798357cbd6ad0a7b528f79 /mkspecs
parent1bb51cb8b1de3ac795d408757812fc57fbf0a902 (diff)
Automatically add QtQuick module if only QtDeclarative is specified
QtQuick and related APIs (QQuickItem, SceneGraph, et al), which used to live in the QtDeclarative module, have moved to a new module, QtQuick. Existing projects that use QtQuick-specific APIs should add "quick" to their project's QT variable, and update their include statements. E.g., QT += declarative should be changed to QT += declarative quick and #include <QtDeclarative/qquickitem.h> should be changed to #include <QtQuick/qquickitem.h> and similarly for the other QtQuick classes. In order to give existing projects a chance to migrate smoothly, we should issue a warning and automatically add the QtQuick module if only the QtDeclarative module was specified. (If a project doesn't use any QtQuick APIs, the warning can be ignored -- but there is no way to disable it.) This change, along with the compatibility headers in QtDeclarative, make it possible to build existing projects without any modifications on the project's side. This change will be removed at a later time; when that happens, existing projects that did not port to the QtQuick module will no longer build. Change-Id: I56abcadc1e5c74490527fc03646310d801bfc084 Reviewed-by: Lars Knoll <>
Diffstat (limited to 'mkspecs')
1 files changed, 9 insertions, 0 deletions
diff --git a/mkspecs/features/qt.prf b/mkspecs/features/qt.prf
index d288930eaf..b0ee214a28 100644
--- a/mkspecs/features/qt.prf
+++ b/mkspecs/features/qt.prf
@@ -1,5 +1,14 @@
CONFIG *= moc thread
+contains(QT, declarative)|contains(QT, declarative-private):!contains(DEFINES, QT_BUILD_QUICK_LIB):!contains(QT, quick):!contains(QT, quick-private) {
+ warning("This project is using the declarative module, but not the quick module.")
+ warning("If you're using QtQuick-specific APIs (QQuickItem, SceneGraph et al), you should add")
+ warning(" QT += quick")
+ warning("to your project's .pro file.")
+ contains(QT, declarative-private):QT += quick-private
+ else:QT += quick
#handle defines
win32 {
qt_static:DEFINES += QT_NODLL