diff options
author | Kent Hansen <kent.hansen@nokia.com> | 2011-11-22 15:56:10 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-11-24 09:10:05 +0100 |
commit | 296951a630d932f0834d26efb8912dc04cf79823 (patch) | |
tree | fd536e0b8faa81e2f9126640e46ec097b7f1bede | |
parent | dcc810fd6ae3042fb2877d617e21818b81b33ead (diff) |
Move registration of QtQuick 2 types to separate class
Just a bit of cleanup to make QtQuick2's definition follow the
convention of QtQuick1, in preparation of moving QtQuick2 to its own
library.
Change-Id: If9e19e5f5512f9417373bb977bcb424186554c8f
Reviewed-by: Martin Jones <martin.jones@nokia.com>
-rw-r--r-- | src/declarative/declarative.pro | 3 | ||||
-rw-r--r-- | src/declarative/qml/qdeclarativeengine.cpp | 10 | ||||
-rw-r--r-- | src/declarative/qtquick2.cpp | 61 | ||||
-rw-r--r-- | src/declarative/qtquick2_p.h | 63 |
4 files changed, 129 insertions, 8 deletions
diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index 31d1e19a18..266aa65b4a 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -36,6 +36,9 @@ include(items/items.pri) include(particles/particles.pri) include(designer/designer.pri) +HEADERS += qtquick2_p.h +SOURCES += qtquick2.cpp + linux-g++-maemo:DEFINES += QDECLARATIVEVIEW_NOBACKGROUND DEFINES += QT_NO_OPENTYPE diff --git a/src/declarative/qml/qdeclarativeengine.cpp b/src/declarative/qml/qdeclarativeengine.cpp index b677a876b4..93d2fa9491 100644 --- a/src/declarative/qml/qdeclarativeengine.cpp +++ b/src/declarative/qml/qdeclarativeengine.cpp @@ -83,9 +83,7 @@ #include <private/qobject_p.h> -#include <private/qdeclarativeutilmodule_p.h> -#include <private/qquickitemsmodule_p.h> -#include <private/qquickparticlesmodule_p.h> +#include <private/qtquick2_p.h> #include <private/qdeclarativelocale_p.h> #ifdef Q_OS_WIN // for %APPDATA% @@ -347,11 +345,7 @@ QDeclarativeEnginePrivate::QDeclarativeEnginePrivate(QDeclarativeEngine *e) { if (!qt_QmlQtModule_registered) { qt_QmlQtModule_registered = true; - QDeclarativeUtilModule::defineModule(); - QDeclarativeEnginePrivate::defineModule(); - QQuickItemsModule::defineModule(); - QQuickParticlesModule::defineModule(); - QDeclarativeValueTypeFactory::registerValueTypes(); + QDeclarativeQtQuick2Module::defineModule(); } } diff --git a/src/declarative/qtquick2.cpp b/src/declarative/qtquick2.cpp new file mode 100644 index 0000000000..64739b3547 --- /dev/null +++ b/src/declarative/qtquick2.cpp @@ -0,0 +1,61 @@ +/**************************************************************************** +** +** 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 QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** 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$ +** +****************************************************************************/ + +#include "qtquick2_p.h" +#include <private/qdeclarativeengine_p.h> +#include <private/qdeclarativeutilmodule_p.h> +#include <private/qdeclarativevaluetype_p.h> +#include <private/qquickitemsmodule_p.h> +#include <private/qquickparticlesmodule_p.h> + +QT_BEGIN_NAMESPACE + +void QDeclarativeQtQuick2Module::defineModule() +{ + QDeclarativeUtilModule::defineModule(); + QDeclarativeEnginePrivate::defineModule(); + QQuickItemsModule::defineModule(); + QQuickParticlesModule::defineModule(); + QDeclarativeValueTypeFactory::registerValueTypes(); +} + +QT_END_NAMESPACE + diff --git a/src/declarative/qtquick2_p.h b/src/declarative/qtquick2_p.h new file mode 100644 index 0000000000..7e2b334124 --- /dev/null +++ b/src/declarative/qtquick2_p.h @@ -0,0 +1,63 @@ +/**************************************************************************** +** +** 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 QtDeclarative module of the Qt Toolkit. +** +** $QT_BEGIN_LICENSE:LGPL$ +** GNU Lesser General Public License Usage +** This file may be used under the terms of the GNU Lesser General Public +** License version 2.1 as published by the Free Software Foundation and +** appearing in the file LICENSE.LGPL included in the packaging of this +** file. Please review the following information to ensure the GNU Lesser +** General Public License version 2.1 requirements will be met: +** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. +** +** In addition, as a special exception, Nokia gives you certain additional +** rights. These rights are described in the Nokia Qt LGPL Exception +** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** +** GNU General Public License Usage +** Alternatively, this file may be used under the terms of the GNU General +** Public License version 3.0 as published by the Free Software Foundation +** and appearing in the file LICENSE.GPL included in the packaging of this +** file. Please review the following information to ensure the GNU General +** Public License version 3.0 requirements will be met: +** http://www.gnu.org/copyleft/gpl.html. +** +** 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$ +** +****************************************************************************/ + +#ifndef QTQUICK2_P_H +#define QTQUICK2_P_H + +#include <private/qdeclarativeglobal_p.h> + +QT_BEGIN_HEADER + +QT_BEGIN_NAMESPACE + +QT_MODULE(Declarative) + +class Q_DECLARATIVE_PRIVATE_EXPORT QDeclarativeQtQuick2Module +{ +public: + static void defineModule(); +}; + +QT_END_NAMESPACE + +QT_END_HEADER + +#endif // QTQUICK2_P_H |