diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-12 03:31:47 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-04-12 03:31:47 (GMT) |
commit | 381ea9c22eb8f6b3701376a650202f094e17746d (patch) | |
tree | 5c0014189bf8c14ae11ad9d246134c839c13c343 /src/imports/widgets | |
parent | 27f8facfea87d7c4669852e7aa0fe5d9ca828eb3 (diff) | |
parent | b6a50a14189da153e93aef581c30863608399714 (diff) | |
download | Qt-381ea9c22eb8f6b3701376a650202f094e17746d.zip Qt-381ea9c22eb8f6b3701376a650202f094e17746d.tar.gz Qt-381ea9c22eb8f6b3701376a650202f094e17746d.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/qt-qml: (130 commits)
Warning
Read Maemo orientation at startup
Exclude gestures from examples autotest
Exclude proxywidgets from examples autotest
Fix crash on QScriptProgram destruction
doc fixes
Start documenting coding conventions
Adds missing qml file to qdeclarativeflipable autotest
Revert "Better reporting of extension plugin loading errors."
Doc
Fix graphicswidget auto-test.
Add Mac OS X bundle description for qml runtime
Cleanup
Disallow writes to read-only value type properties
Allow undefined to be assigned to QVariant properties
Add a Qt.isQtObject() method
Fix crash in QML library imports
Remove QT_VERSION checks in QML
List properties aren't read-only
Small doc fix.
...
Diffstat (limited to 'src/imports/widgets')
-rw-r--r-- | src/imports/widgets/graphicslayouts_p.h | 3 | ||||
-rw-r--r-- | src/imports/widgets/graphicswidgets.cpp | 40 | ||||
-rw-r--r-- | src/imports/widgets/graphicswidgets_p.h | 68 | ||||
-rw-r--r-- | src/imports/widgets/widgets.cpp | 70 | ||||
-rw-r--r-- | src/imports/widgets/widgets.pro | 1 |
5 files changed, 3 insertions, 179 deletions
diff --git a/src/imports/widgets/graphicslayouts_p.h b/src/imports/widgets/graphicslayouts_p.h index f9b9ae8..1c3dfe5 100644 --- a/src/imports/widgets/graphicslayouts_p.h +++ b/src/imports/widgets/graphicslayouts_p.h @@ -42,10 +42,9 @@ #ifndef GRAPHICSLAYOUTS_H #define GRAPHICSLAYOUTS_H -#include "graphicswidgets_p.h" - #include <QtGui/QGraphicsLinearLayout> #include <QtGui/QGraphicsGridLayout> +#include <qdeclarative.h> QT_BEGIN_HEADER diff --git a/src/imports/widgets/graphicswidgets.cpp b/src/imports/widgets/graphicswidgets.cpp deleted file mode 100644 index 062e516..0000000 --- a/src/imports/widgets/graphicswidgets.cpp +++ /dev/null @@ -1,40 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 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$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, 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. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ diff --git a/src/imports/widgets/graphicswidgets_p.h b/src/imports/widgets/graphicswidgets_p.h deleted file mode 100644 index 2c2b707..0000000 --- a/src/imports/widgets/graphicswidgets_p.h +++ /dev/null @@ -1,68 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2010 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$ -** No Commercial Usage -** This file contains pre-release code and may not be distributed. -** You may use this file in accordance with the terms and conditions -** contained in the Technology Preview License Agreement accompanying -** this package. -** -** GNU Lesser General Public License Usage -** Alternatively, 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. -** -** If you have questions regarding the use of this file, please contact -** Nokia at qt-info@nokia.com. -** -** -** -** -** -** -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef GRAPHICSWIDGETS_H -#define GRAPHICSWIDGETS_H - -#include <qdeclarative.h> - -#include <QtGui/QGraphicsScene> -#include <QtGui/QGraphicsView> -#include <QtGui/QGraphicsWidget> -#include <QtGui/QGraphicsItem> - -QT_BEGIN_HEADER - -QT_BEGIN_NAMESPACE - -QT_MODULE(Declarative) - -QT_END_NAMESPACE - -QML_DECLARE_TYPE(QGraphicsView) -QML_DECLARE_TYPE_HASMETATYPE(QGraphicsScene) -QML_DECLARE_TYPE(QGraphicsWidget) -QML_DECLARE_TYPE(QGraphicsObject) -QML_DECLARE_INTERFACE_HASMETATYPE(QGraphicsItem) - -QT_END_HEADER - -#endif // GRAPHICSWIDGETS_H diff --git a/src/imports/widgets/widgets.cpp b/src/imports/widgets/widgets.cpp index bc18e8a..f26969a 100644 --- a/src/imports/widgets/widgets.cpp +++ b/src/imports/widgets/widgets.cpp @@ -41,75 +41,12 @@ #include <QtDeclarative/qdeclarativeextensionplugin.h> #include <QtDeclarative/qdeclarative.h> +#include <QGraphicsWidget> #include "graphicslayouts_p.h" -#include "graphicswidgets_p.h" QT_BEGIN_NAMESPACE -class QGraphicsViewDeclarativeUI : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QGraphicsScene *scene READ scene WRITE setScene) - Q_CLASSINFO("DefaultProperty", "scene") -public: - QGraphicsViewDeclarativeUI(QObject *other) : QObject(other) {} - - QGraphicsScene *scene() const { return static_cast<QGraphicsView *>(parent())->scene(); } - void setScene(QGraphicsScene *scene) - { - static_cast<QGraphicsView *>(parent())->setScene(scene); - } -}; - -class QGraphicsSceneDeclarativeUI : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QDeclarativeListProperty<QObject> children READ children) - Q_CLASSINFO("DefaultProperty", "children") -public: - QGraphicsSceneDeclarativeUI(QObject *other) : QObject(other) {} - - QDeclarativeListProperty<QObject> children() { return QDeclarativeListProperty<QObject>(this->parent(), 0, children_append); } - -private: - static void children_append(QDeclarativeListProperty<QObject> *prop, QObject *o) { - if (QGraphicsObject *go = qobject_cast<QGraphicsObject *>(o)) - static_cast<QGraphicsScene *>(prop->object)->addItem(go); - } -}; - -class QGraphicsWidgetDeclarativeUI : public QObject -{ - Q_OBJECT - - Q_PROPERTY(QDeclarativeListProperty<QGraphicsItem> children READ children) - Q_PROPERTY(QGraphicsLayout *layout READ layout WRITE setLayout) - Q_CLASSINFO("DefaultProperty", "children") -public: - QGraphicsWidgetDeclarativeUI(QObject *other) : QObject(other) {} - - QDeclarativeListProperty<QGraphicsItem> children() { return QDeclarativeListProperty<QGraphicsItem>(this, 0, children_append); } - - QGraphicsLayout *layout() const { return static_cast<QGraphicsWidget *>(parent())->layout(); } - void setLayout(QGraphicsLayout *lo) - { - static_cast<QGraphicsWidget *>(parent())->setLayout(lo); - } - -private: - void setItemParent(QGraphicsItem *wid) - { - wid->setParentItem(static_cast<QGraphicsWidget *>(parent())); - } - - static void children_append(QDeclarativeListProperty<QGraphicsItem> *prop, QGraphicsItem *i) { - static_cast<QGraphicsWidgetDeclarativeUI*>(prop->object)->setItemParent(i); - } -}; - class QWidgetsQmlModule : public QDeclarativeExtensionPlugin { Q_OBJECT @@ -123,10 +60,7 @@ public: qmlRegisterType<QGraphicsLinearLayoutStretchItemObject>(uri,4,6,"QGraphicsLinearLayoutStretchItem"); qmlRegisterType<QGraphicsLinearLayoutObject>(uri,4,6,"QGraphicsLinearLayout"); qmlRegisterType<QGraphicsGridLayoutObject>(uri,4,6,"QGraphicsGridLayout"); - qmlRegisterExtendedType<QGraphicsView, QGraphicsViewDeclarativeUI>(uri,4,6,"QGraphicsView"); - qmlRegisterExtendedType<QGraphicsScene,QGraphicsSceneDeclarativeUI>(uri,4,6,"QGraphicsScene"); - qmlRegisterExtendedType<QGraphicsWidget,QGraphicsWidgetDeclarativeUI>(uri,4,6,"QGraphicsWidget"); - qmlRegisterInterface<QGraphicsItem>("QGraphicsItem"); + qmlRegisterType<QGraphicsWidget>(uri,4,6,"QGraphicsWidget"); } }; diff --git a/src/imports/widgets/widgets.pro b/src/imports/widgets/widgets.pro index 408f878..f26e4b9 100644 --- a/src/imports/widgets/widgets.pro +++ b/src/imports/widgets/widgets.pro @@ -9,7 +9,6 @@ SOURCES += \ widgets.cpp HEADERS += \ - graphicswidgets_p.h \ graphicslayouts_p.h QTDIR_build:DESTDIR = $$QT_BUILD_TREE/imports/$$TARGETPATH |