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 <lars.knoll@nokia.com>
This commit is contained in:
Kent Hansen 2011-11-25 12:13:16 +01:00 committed by Qt by Nokia
parent 1bb51cb8b1
commit 613183ff8c

View File

@ -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