Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Say hello to QtQuick module
This change moves the QtQuick 2 types and C++ API (including
SceneGraph) to a new module (AKA library), QtQuick.

99% of this change is moving files from src/declarative to
src/quick, and from tests/auto/declarative to
tests/auto/qtquick2.

The loading of QtQuick 2 ("import QtQuick 2.0") is now delegated to
a plugin, src/imports/qtquick2, just like it's done for QtQuick 1.

All tools, examples, and tests that use QtQuick C++ API have gotten
"QT += quick" or "QT += quick-private" added to their .pro file.

A few additional internal QtDeclarative classes had to be exported
(via Q_DECLARATIVE_PRIVATE_EXPORT) since they're needed by the
QtQuick 2 implementation.

The old header locations (e.g. QtDeclarative/qquickitem.h) will
still be supported for some time, but will produce compile-time
warnings. (To avoid the QtQuick implementation using the
compatibility headers (since QtDeclarative's includepath comes
first), a few include statements were modified, e.g. from
"#include <qsgnode.h>" to "#include <QtQuick/qsgnode.h>".)

There's a change in qtbase that automatically adds QtQuick to the
module list if QtDeclarative is used. Together with the compatibility
headers, this should help reduce the migration pain for existing
projects.

In theory, simply getting an existing QtDeclarative-based project
to compile and link shouldn't require any changes for now -- but
porting to the new scheme is of course recommended, and will
eventually become mandatory.

Task-number: QTBUG-22889
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Change-Id: Ia52be9373172ba2f37e7623231ecb060316c96a7
Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com>
  • Loading branch information
Kent Hansen authored and Qt by Nokia committed Dec 2, 2011
1 parent e01219b commit 6c8378e
Show file tree
Hide file tree
Showing 1,174 changed files with 1,275 additions and 1,091 deletions.
52 changes: 52 additions & 0 deletions doc/src/quick/qtquick.qdoc
@@ -0,0 +1,52 @@
/****************************************************************************
**
** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the documentation of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:FDL$
** GNU Free Documentation License
** Alternatively, this file may be used under the terms of the GNU Free
** Documentation License version 1.3 as published by the Free Software
** Foundation and appearing in the file included in the packaging of
** this file.
**
** Other Usage
** Alternatively, this file may be used in accordance with the terms
** and conditions contained in a signed written agreement between you
** and Nokia.
**
**
**
**
** $QT_END_LICENSE$
**
****************************************************************************/

/*!
\module QtQuick
\title Qt Quick Module
\ingroup modules

\brief The Qt Quick module provides classes for embedding Qt Quick
in Qt/C++ applications.

To include the definitions of the module's classes, use the
following directive:

\code
#include <QtQuick>
\endcode

To link against the module, add this line to your \l qmake \c
.pro file:

\code
QT += quick
\endcode

For more information on the Qt Quick module, see the
\l{Qt Quick} documentation.
*/
Expand Up @@ -44,7 +44,7 @@

#include <QDeclarativeEngine>
#include <QDeclarativeNetworkAccessManagerFactory>
#include <QQuickView>
#include <QtQuick/QQuickView>


/*
Expand Down
Expand Up @@ -2,7 +2,7 @@ TEMPLATE = app
TARGET = networkaccessmanagerfactory
DEPENDPATH += .
INCLUDEPATH += .
QT += declarative network
QT += declarative quick network

# Input
SOURCES += main.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/minehunt/main.cpp
Expand Up @@ -40,7 +40,7 @@
****************************************************************************/

#include <QtGui/QGuiApplication>
#include <qquickview.h>
#include <QtQuick/qquickview.h>
#include <QtDeclarative/QDeclarativeContext>
#include <QtDeclarative/QDeclarativeEngine>

Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/minehunt/minehunt.pro
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = minehunt
QT += declarative
QT += declarative quick

# Input
HEADERS += minehunt.h
Expand Down
Expand Up @@ -2,7 +2,7 @@ TEMPLATE = app
TARGET = abstractitemmodel
DEPENDPATH += .
INCLUDEPATH += .
QT += declarative
QT += declarative quick

HEADERS = model.h
SOURCES = main.cpp \
Expand Down
4 changes: 2 additions & 2 deletions examples/declarative/modelviews/abstractitemmodel/main.cpp
Expand Up @@ -43,8 +43,8 @@
#include <qdeclarativeengine.h>
#include <qdeclarativecontext.h>
#include <qdeclarative.h>
#include <qquickitem.h>
#include <qquickview.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>

//![0]
int main(int argc, char ** argv)
Expand Down
4 changes: 2 additions & 2 deletions examples/declarative/modelviews/objectlistmodel/main.cpp
Expand Up @@ -43,8 +43,8 @@
#include <qdeclarativeengine.h>
#include <qdeclarativecontext.h>
#include <qdeclarative.h>
#include <qquickitem.h>
#include <qquickview.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>

#include "dataobject.h"

Expand Down
Expand Up @@ -2,7 +2,7 @@ TEMPLATE = app
TARGET = objectlistmodel
DEPENDPATH += .
INCLUDEPATH += .
QT += declarative
QT += declarative quick

# Input
SOURCES += main.cpp \
Expand Down
4 changes: 2 additions & 2 deletions examples/declarative/modelviews/stringlistmodel/main.cpp
Expand Up @@ -44,8 +44,8 @@
#include <qdeclarativeengine.h>
#include <qdeclarativecontext.h>
#include <qdeclarative.h>
#include <qquickitem.h>
#include <qquickview.h>
#include <QtQuick/qquickitem.h>
#include <QtQuick/qquickview.h>


/*
Expand Down
Expand Up @@ -2,7 +2,7 @@ TEMPLATE = app
TARGET = stringlistmodel
DEPENDPATH += .
INCLUDEPATH += .
QT += declarative
QT += declarative quick

# Input
SOURCES += main.cpp
Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/openglunderqml/main.cpp
Expand Up @@ -41,7 +41,7 @@

#include <QGuiApplication>

#include <QQuickView>
#include <QtQuick/QQuickView>

#include "squircle.h"

Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/openglunderqml/openglunderqml.pro
@@ -1,4 +1,4 @@
QT += declarative
QT += declarative quick

TEMPLATE = app
DEPENDPATH += .
Expand Down
4 changes: 2 additions & 2 deletions examples/declarative/openglunderqml/squircle.cpp
Expand Up @@ -41,8 +41,8 @@

#include "squircle.h"

#include <qsgengine.h>
#include <qquickcanvas.h>
#include <QtQuick/qsgengine.h>
#include <QtQuick/qquickcanvas.h>
#include <QOpenGLShaderProgram>

Squircle::Squircle()
Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/openglunderqml/squircle.h
Expand Up @@ -42,7 +42,7 @@
#ifndef SQUIRCLE_H
#define SQUIRCLE_H

#include <QtDeclarative/QQuickItem>
#include <QtQuick/QQuickItem>
#include <QtGui/QOpenGLShaderProgram>

class Squircle : public QQuickItem
Expand Down
4 changes: 2 additions & 2 deletions examples/declarative/painteditem/smile/main.cpp
Expand Up @@ -41,8 +41,8 @@
#include <QGuiApplication>
#include <QPainter>
#include <QtDeclarative/qdeclarative.h>
#include <QtDeclarative/qquickview.h>
#include <QtDeclarative/qquickpainteditem.h>
#include <QtQuick/qquickview.h>
#include <QtQuick/qquickpainteditem.h>
class MyPaintItem : public QQuickPaintedItem
{
Q_OBJECT
Expand Down
2 changes: 1 addition & 1 deletion examples/declarative/painteditem/smile/smile.pro
@@ -1,7 +1,7 @@
TEMPLATE = app
TARGET = painteditem

QT += declarative
QT += declarative quick

macx: CONFIG -= app_bundle

Expand Down
Expand Up @@ -42,7 +42,7 @@
#ifndef TEXTBALLOON_H
#define TEXTBALLOON_H

#include <QtDeclarative>
#include <QtQuick>

//! [0]
class TextBalloon : public QQuickPaintedItem
Expand Down
@@ -1,6 +1,6 @@
TEMPLATE = lib
CONFIG += qt plugin
QT += declarative
QT += declarative quick

TARGET = qmltextballoonplugin

Expand Down
@@ -1,4 +1,4 @@
QT += declarative
QT += declarative quick

HEADERS += piechart.h
SOURCES += piechart.cpp \
Expand Down
Expand Up @@ -39,7 +39,7 @@
****************************************************************************/
//![0]
#include "piechart.h"
#include <QQuickView>
#include <QtQuick/QQuickView>
#include <QGuiApplication>

int main(int argc, char *argv[])
Expand Down
Expand Up @@ -41,7 +41,7 @@
#define PIECHART_H

//![0]
#include <QtDeclarative/QQuickPaintedItem>
#include <QtQuick/QQuickPaintedItem>
#include <QColor>

class PieChart : public QQuickPaintedItem
Expand Down
@@ -1,4 +1,4 @@
QT += declarative
QT += declarative quick

HEADERS += piechart.h
SOURCES += piechart.cpp \
Expand Down
Expand Up @@ -39,7 +39,7 @@
****************************************************************************/
//![0]
#include "piechart.h"
#include <QQuickView>
#include <QtQuick/QQuickView>
#include <QGuiApplication>

int main(int argc, char *argv[])
Expand Down
Expand Up @@ -40,7 +40,7 @@
#ifndef PIECHART_H
#define PIECHART_H

#include <QtDeclarative/QQuickPaintedItem>
#include <QtQuick/QQuickPaintedItem>
#include <QColor>

//![0]
Expand Down
@@ -1,4 +1,4 @@
QT += declarative
QT += declarative quick

HEADERS += piechart.h
SOURCES += piechart.cpp \
Expand Down
Expand Up @@ -39,7 +39,7 @@
****************************************************************************/
//![0]
#include "piechart.h"
#include <QQuickView>
#include <QtQuick/QQuickView>
#include <QGuiApplication>

int main(int argc, char *argv[])
Expand Down
Expand Up @@ -41,7 +41,7 @@
#define PIECHART_H

#include <QColor>
#include <QtDeclarative/QQuickPaintedItem>
#include <QtQuick/QQuickPaintedItem>

//![0]
class PieChart : public QQuickPaintedItem
Expand Down
@@ -1,4 +1,4 @@
QT += declarative
QT += declarative quick

HEADERS += piechart.h \
pieslice.h
Expand Down
Expand Up @@ -40,7 +40,7 @@
#include "piechart.h"
#include "pieslice.h"

#include <QQuickView>
#include <QtQuick/QQuickView>
#include <QGuiApplication>

//![0]
Expand Down
Expand Up @@ -40,7 +40,7 @@
#ifndef PIECHART_H
#define PIECHART_H

#include <QtDeclarative/QQuickItem>
#include <QtQuick/QQuickItem>

class PieSlice;

Expand Down
Expand Up @@ -40,7 +40,7 @@
#ifndef PIESLICE_H
#define PIESLICE_H

#include <QtDeclarative/QQuickPaintedItem>
#include <QtQuick/QQuickPaintedItem>
#include <QColor>

//![0]
Expand Down
@@ -1,4 +1,4 @@
QT += declarative
QT += declarative quick

HEADERS += piechart.h \
pieslice.h
Expand Down
Expand Up @@ -40,7 +40,7 @@
#include "piechart.h"
#include "pieslice.h"

#include <QQuickView>
#include <QtQuick/QQuickView>
#include <QGuiApplication>

int main(int argc, char *argv[])
Expand Down
Expand Up @@ -40,7 +40,7 @@
#ifndef PIECHART_H
#define PIECHART_H

#include <QQuickItem>
#include <QtQuick/QQuickItem>

class PieSlice;

Expand Down
Expand Up @@ -40,7 +40,7 @@
#ifndef PIESLICE_H
#define PIESLICE_H

#include <QtDeclarative/QQuickPaintedItem>
#include <QtQuick/QQuickPaintedItem>
#include <QColor>

//![0]
Expand Down
@@ -1,6 +1,6 @@
TEMPLATE = lib
CONFIG += qt plugin
QT += declarative
QT += declarative quick

DESTDIR = ChartsPlugin
TARGET = chartsplugin
Expand Down
Expand Up @@ -40,7 +40,7 @@
#ifndef PIECHART_H
#define PIECHART_H

#include <QQuickItem>
#include <QtQuick/QQuickItem>

class PieSlice;

Expand Down
Expand Up @@ -40,7 +40,7 @@
#ifndef PIESLICE_H
#define PIESLICE_H

#include <QtDeclarative/QQuickPaintedItem>
#include <QtQuick/QQuickPaintedItem>
#include <QColor>

class PieSlice : public QQuickPaintedItem
Expand Down

0 comments on commit 6c8378e

Please sign in to comment.