summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/debugger/qmldebugservice.cpp33
-rw-r--r--src/declarative/debugger/qmldebugservice_p.h4
-rw-r--r--src/declarative/graphicsitems/graphicsitems.pri3
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsanchors.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp1
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsborderimage.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicseffects.cpp13
-rw-r--r--src/declarative/graphicsitems/qmlgraphicseffects_p.h65
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsevents.cpp3
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflickable.cpp37
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflickable_p_p.h32
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsflipable.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsfocuspanel.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsfocusscope.cpp1
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp3
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsgridview.cpp61
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsgridview_p.h58
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsimage.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem.cpp210
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem.h2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitem_p.h201
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitemsmodule.cpp164
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsitemsmodule_p.h63
-rw-r--r--src/declarative/graphicsitems/qmlgraphicslayoutitem.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicslistview.cpp71
-rw-r--r--src/declarative/graphicsitems/qmlgraphicslistview_p.h67
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsloader.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp3
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsparticles.cpp10
-rw-r--r--src/declarative/graphicsitems/qmlgraphicspath.cpp8
-rw-r--r--src/declarative/graphicsitems/qmlgraphicspathview.cpp3
-rw-r--r--src/declarative/graphicsitems/qmlgraphicspositioners.cpp4
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsrectangle.cpp4
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsrepeater.cpp2
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsscalegrid.cpp1
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstext.cpp1
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstextedit.cpp1
-rw-r--r--src/declarative/graphicsitems/qmlgraphicstextinput.cpp6
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp42
-rw-r--r--src/declarative/graphicsitems/qmlgraphicsvisualitemmodel_p.h39
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview.cpp28
-rw-r--r--src/declarative/graphicsitems/qmlgraphicswebview_p.h26
-rw-r--r--src/declarative/qml/qmlcomponent.cpp1
-rw-r--r--src/declarative/qml/qmlengine.cpp8
44 files changed, 763 insertions, 530 deletions
diff --git a/src/declarative/debugger/qmldebugservice.cpp b/src/declarative/debugger/qmldebugservice.cpp
index 810fbed..2c9586f 100644
--- a/src/declarative/debugger/qmldebugservice.cpp
+++ b/src/declarative/debugger/qmldebugservice.cpp
@@ -61,9 +61,11 @@ class QmlDebugServer : public QObject
public:
static QmlDebugServer *instance();
void wait();
+ void registerForStartNotification(QObject *object, const char *receiver);
private Q_SLOTS:
void readyRead();
+ void registeredObjectDestroyed(QObject *object);
private:
friend class QmlDebugService;
@@ -83,6 +85,7 @@ public:
QPacketProtocol *protocol;
QHash<QString, QmlDebugService *> plugins;
QStringList enabledPlugins;
+ QList<QPair<QObject*, QByteArray> > notifyClients;
};
class QmlDebugServicePrivate : public QObjectPrivate
@@ -112,6 +115,14 @@ void QmlDebugServerPrivate::wait()
qWarning("QmlDebugServer: Waiting for connection on port %d...", port);
+ for (int i=0; i<notifyClients.count(); i++) {
+ if (!QMetaObject::invokeMethod(notifyClients[i].first, notifyClients[i].second)) {
+ qWarning() << "QmlDebugServer: unable to call method" << notifyClients[i].second
+ << "on object" << notifyClients[i].first << "to notify of debug server start";
+ }
+ }
+ notifyClients.clear();
+
if (!server.waitForNewConnection(-1)) {
qWarning("QmlDebugServer: Connection error");
return;
@@ -165,6 +176,23 @@ void QmlDebugServer::wait()
d->wait();
}
+void QmlDebugServer::registerForStartNotification(QObject *object, const char *methodName)
+{
+ Q_D(QmlDebugServer);
+ connect(object, SIGNAL(destroyed(QObject*)), SLOT(registeredObjectDestroyed(QObject*)));
+ d->notifyClients.append(qMakePair(object, QByteArray(methodName)));
+}
+
+void QmlDebugServer::registeredObjectDestroyed(QObject *object)
+{
+ Q_D(QmlDebugServer);
+ QMutableListIterator<QPair<QObject*, QByteArray> > i(d->notifyClients);
+ while (i.hasNext()) {
+ if (i.next().first == object)
+ i.remove();
+ }
+}
+
QmlDebugServer::QmlDebugServer(int port)
: QObject(*(new QmlDebugServerPrivate))
{
@@ -367,6 +395,11 @@ void QmlDebugService::waitForClients()
QmlDebugServer::instance()->wait();
}
+void QmlDebugService::notifyOnServerStart(QObject *object, const char *receiver)
+{
+ QmlDebugServer::instance()->registerForStartNotification(object, receiver);
+}
+
void QmlDebugService::sendMessage(const QByteArray &message)
{
Q_D(QmlDebugService);
diff --git a/src/declarative/debugger/qmldebugservice_p.h b/src/declarative/debugger/qmldebugservice_p.h
index b406a3c..ec90d95 100644
--- a/src/declarative/debugger/qmldebugservice_p.h
+++ b/src/declarative/debugger/qmldebugservice_p.h
@@ -68,17 +68,19 @@ public:
static int idForObject(QObject *);
static QObject *objectForId(int);
-
static bool isDebuggingEnabled();
static QString objectToString(QObject *obj);
static void waitForClients();
+ static void notifyOnServerStart(QObject *object, const char *receiver);
+
protected:
virtual void enabledChanged(bool);
virtual void messageReceived(const QByteArray &);
private:
+ void registerForStartNotification(QObject *object, const char *methodName);
friend class QmlDebugServer;
};
diff --git a/src/declarative/graphicsitems/graphicsitems.pri b/src/declarative/graphicsitems/graphicsitems.pri
index eb6e0ad..db9c29e 100644
--- a/src/declarative/graphicsitems/graphicsitems.pri
+++ b/src/declarative/graphicsitems/graphicsitems.pri
@@ -1,9 +1,11 @@
INCLUDEPATH += $$PWD
HEADERS += \
+ $$PWD/qmlgraphicsitemsmodule_p.h \
$$PWD/qmlgraphicsanchors_p.h \
$$PWD/qmlgraphicsanchors_p_p.h \
$$PWD/qmlgraphicsevents_p_p.h \
+ $$PWD/qmlgraphicseffects_p.h \
$$PWD/qmlgraphicsflickable_p.h \
$$PWD/qmlgraphicsflickable_p_p.h \
$$PWD/qmlgraphicsflipable_p.h \
@@ -52,6 +54,7 @@ HEADERS += \
$$PWD/qmlgraphicseffects.cpp
SOURCES += \
+ $$PWD/qmlgraphicsitemsmodule.cpp \
$$PWD/qmlgraphicsanchors.cpp \
$$PWD/qmlgraphicsevents.cpp \
$$PWD/qmlgraphicsflickable.cpp \
diff --git a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
index 93055fc..816e580 100644
--- a/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsanchors.cpp
@@ -50,8 +50,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_NOCREATE_TYPE(QmlGraphicsAnchors)
-
//TODO: should we cache relationships, so we don't have to check each time (parent-child or sibling)?
//TODO: support non-parent, non-sibling (need to find lowest common ancestor)
diff --git a/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp b/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp
index e01e569..7d1c87a 100644
--- a/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsanimatedimage.cpp
@@ -78,7 +78,6 @@ Item {
\endqml
\endtable
*/
-QML_DEFINE_TYPE(Qt,4,6,AnimatedImage,QmlGraphicsAnimatedImage)
QmlGraphicsAnimatedImage::QmlGraphicsAnimatedImage(QmlGraphicsItem *parent)
: QmlGraphicsImage(*(new QmlGraphicsAnimatedImagePrivate), parent)
diff --git a/src/declarative/graphicsitems/qmlgraphicsborderimage.cpp b/src/declarative/graphicsitems/qmlgraphicsborderimage.cpp
index 877e141..19da151 100644
--- a/src/declarative/graphicsitems/qmlgraphicsborderimage.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsborderimage.cpp
@@ -50,8 +50,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,BorderImage,QmlGraphicsBorderImage)
-
/*!
\qmlclass BorderImage QmlGraphicsBorderImage
\brief The BorderImage element provides an image that can be used as a border.
diff --git a/src/declarative/graphicsitems/qmlgraphicseffects.cpp b/src/declarative/graphicsitems/qmlgraphicseffects.cpp
index e1f5687..268ba28 100644
--- a/src/declarative/graphicsitems/qmlgraphicseffects.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicseffects.cpp
@@ -43,12 +43,6 @@
#include <QtGui/qgraphicseffect.h>
-QML_DECLARE_TYPE(QGraphicsEffect)
-QML_DEFINE_NOCREATE_TYPE(QGraphicsEffect)
-
-QML_DECLARE_TYPE(QGraphicsBlurEffect)
-QML_DEFINE_TYPE(Qt,4,6,Blur,QGraphicsBlurEffect)
-
/*!
\qmlclass Blur QGraphicsBlurEffect
\brief The Blur object provides a blur effect.
@@ -84,9 +78,6 @@ QML_DEFINE_TYPE(Qt,4,6,Blur,QGraphicsBlurEffect)
The default hint is Qt.PerformanceHint.
*/
-QML_DECLARE_TYPE(QGraphicsColorizeEffect)
-QML_DEFINE_TYPE(Qt,4,6,Colorize,QGraphicsColorizeEffect)
-
/*!
\qmlclass Colorize QGraphicsColorizeEffect
\brief The Colorize object provides a colorize effect.
@@ -112,8 +103,6 @@ QML_DEFINE_TYPE(Qt,4,6,Colorize,QGraphicsColorizeEffect)
while 1.0 means full colorization. By default, the strength is 1.0.
*/
-QML_DECLARE_TYPE(QGraphicsDropShadowEffect)
-QML_DEFINE_TYPE(Qt,4,6,DropShadow,QGraphicsDropShadowEffect)
/*!
\qmlclass DropShadow QGraphicsDropShadowEffect
@@ -155,8 +144,6 @@ QML_DEFINE_TYPE(Qt,4,6,DropShadow,QGraphicsDropShadowEffect)
By default, the drop color is a semi-transparent dark gray.
*/
-QML_DECLARE_TYPE(QGraphicsOpacityEffect)
-QML_DEFINE_TYPE(Qt,4,6,Opacity,QGraphicsOpacityEffect)
/*!
\qmlclass Opacity QGraphicsOpacityEffect
diff --git a/src/declarative/graphicsitems/qmlgraphicseffects_p.h b/src/declarative/graphicsitems/qmlgraphicseffects_p.h
new file mode 100644
index 0000000..2e561f8
--- /dev/null
+++ b/src/declarative/graphicsitems/qmlgraphicseffects_p.h
@@ -0,0 +1,65 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 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 QMLGRAPHICSEFFECTS_P_H
+#define QMLGRAPHICSEFFECTS_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <qml.h>
+#include <QtGui/qgraphicseffect.h>
+
+QML_DECLARE_TYPE(QGraphicsEffect)
+QML_DECLARE_TYPE(QGraphicsBlurEffect)
+QML_DECLARE_TYPE(QGraphicsColorizeEffect)
+QML_DECLARE_TYPE(QGraphicsDropShadowEffect)
+QML_DECLARE_TYPE(QGraphicsOpacityEffect)
+
+#endif // QMLGRAPHICSEFFECTS_P_H
diff --git a/src/declarative/graphicsitems/qmlgraphicsevents.cpp b/src/declarative/graphicsitems/qmlgraphicsevents.cpp
index 9958dea..0d6adf6 100644
--- a/src/declarative/graphicsitems/qmlgraphicsevents.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsevents.cpp
@@ -189,7 +189,4 @@ MouseRegion {
\endqml
*/
-QML_DEFINE_NOCREATE_TYPE(QmlGraphicsKeyEvent)
-QML_DEFINE_NOCREATE_TYPE(QmlGraphicsMouseEvent)
-
QT_END_NAMESPACE
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
index 2ff3b30..5143251 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsflickable.cpp
@@ -56,36 +56,6 @@ static const int FlickThreshold = 20;
// Really slow flicks can be annoying.
static const int minimumFlickVelocity = 200;
-class QmlGraphicsFlickableVisibleArea : public QObject
-{
- Q_OBJECT
-
- Q_PROPERTY(qreal xPosition READ xPosition NOTIFY pageChanged)
- Q_PROPERTY(qreal yPosition READ yPosition NOTIFY pageChanged)
- Q_PROPERTY(qreal widthRatio READ widthRatio NOTIFY pageChanged)
- Q_PROPERTY(qreal heightRatio READ heightRatio NOTIFY pageChanged)
-
-public:
- QmlGraphicsFlickableVisibleArea(QmlGraphicsFlickable *parent=0);
-
- qreal xPosition() const;
- qreal widthRatio() const;
- qreal yPosition() const;
- qreal heightRatio() const;
-
- void updateVisible();
-
-signals:
- void pageChanged();
-
-private:
- QmlGraphicsFlickable *flickable;
- qreal m_xPosition;
- qreal m_widthRatio;
- qreal m_yPosition;
- qreal m_heightRatio;
-};
-
QmlGraphicsFlickableVisibleArea::QmlGraphicsFlickableVisibleArea(QmlGraphicsFlickable *parent)
: QObject(parent), flickable(parent), m_xPosition(0.), m_widthRatio(0.)
, m_yPosition(0.), m_heightRatio(0.)
@@ -356,8 +326,6 @@ void QmlGraphicsFlickablePrivate::updateBeginningEnd()
visibleArea->updateVisible();
}
-QML_DEFINE_TYPE(Qt,4,6,Flickable,QmlGraphicsFlickable)
-
/*!
\qmlclass Flickable QmlGraphicsFlickable
\brief The Flickable item provides a surface that can be "flicked".
@@ -1367,8 +1335,3 @@ void QmlGraphicsFlickablePrivate::updateVelocity()
}
QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QmlGraphicsFlickableVisibleArea)
-QML_DEFINE_TYPE(Qt,4,6,VisibleArea,QmlGraphicsFlickableVisibleArea)
-
-#include <qmlgraphicsflickable.moc>
diff --git a/src/declarative/graphicsitems/qmlgraphicsflickable_p_p.h b/src/declarative/graphicsitems/qmlgraphicsflickable_p_p.h
index ae164cc..e83e81b 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflickable_p_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsflickable_p_p.h
@@ -159,6 +159,38 @@ public:
QML_DECLARE_LIST_PROXY(QmlGraphicsFlickablePrivate, QObject *, data)
};
+class QmlGraphicsFlickableVisibleArea : public QObject
+{
+ Q_OBJECT
+
+ Q_PROPERTY(qreal xPosition READ xPosition NOTIFY pageChanged)
+ Q_PROPERTY(qreal yPosition READ yPosition NOTIFY pageChanged)
+ Q_PROPERTY(qreal widthRatio READ widthRatio NOTIFY pageChanged)
+ Q_PROPERTY(qreal heightRatio READ heightRatio NOTIFY pageChanged)
+
+public:
+ QmlGraphicsFlickableVisibleArea(QmlGraphicsFlickable *parent=0);
+
+ qreal xPosition() const;
+ qreal widthRatio() const;
+ qreal yPosition() const;
+ qreal heightRatio() const;
+
+ void updateVisible();
+
+signals:
+ void pageChanged();
+
+private:
+ QmlGraphicsFlickable *flickable;
+ qreal m_xPosition;
+ qreal m_widthRatio;
+ qreal m_yPosition;
+ qreal m_heightRatio;
+};
+
QT_END_NAMESPACE
+QML_DECLARE_TYPE(QmlGraphicsFlickableVisibleArea)
+
#endif
diff --git a/src/declarative/graphicsitems/qmlgraphicsflipable.cpp b/src/declarative/graphicsitems/qmlgraphicsflipable.cpp
index ff8995b..4116817 100644
--- a/src/declarative/graphicsitems/qmlgraphicsflipable.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsflipable.cpp
@@ -49,8 +49,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,Flipable,QmlGraphicsFlipable)
-
class QmlGraphicsFlipablePrivate : public QmlGraphicsItemPrivate
{
Q_DECLARE_PUBLIC(QmlGraphicsFlipable)
diff --git a/src/declarative/graphicsitems/qmlgraphicsfocuspanel.cpp b/src/declarative/graphicsitems/qmlgraphicsfocuspanel.cpp
index 333b689..4e1542a 100644
--- a/src/declarative/graphicsitems/qmlgraphicsfocuspanel.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsfocuspanel.cpp
@@ -46,8 +46,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,FocusPanel,QmlGraphicsFocusPanel)
-
/*!
\qmlclass FocusPanel QmlGraphicsFocusPanel
\brief The FocusPanel item explicitly creates a focus panel.
diff --git a/src/declarative/graphicsitems/qmlgraphicsfocusscope.cpp b/src/declarative/graphicsitems/qmlgraphicsfocusscope.cpp
index 828756c..ce0e376 100644
--- a/src/declarative/graphicsitems/qmlgraphicsfocusscope.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsfocusscope.cpp
@@ -42,7 +42,6 @@
#include "qmlgraphicsfocusscope_p.h"
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,FocusScope,QmlGraphicsFocusScope)
/*!
\qmlclass FocusScope QmlGraphicsFocusScope
diff --git a/src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp b/src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp
index a5a7935..f2b3c00 100644
--- a/src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsgraphicsobjectcontainer.cpp
@@ -131,9 +131,6 @@ public:
\brief The QmlGraphicsGraphicsObjectContainer class allows you to add QGraphicsObjects into Fluid UI applications.
*/
-QML_DEFINE_NOCREATE_TYPE(QGraphicsObject)
-QML_DEFINE_TYPE(Qt,4,6,GraphicsObjectContainer,QmlGraphicsGraphicsObjectContainer)
-
QmlGraphicsGraphicsObjectContainer::QmlGraphicsGraphicsObjectContainer(QmlGraphicsItem *parent)
: QmlGraphicsItem(*new QmlGraphicsGraphicsObjectContainerPrivate, parent)
{
diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
index 83911c0..ee711b4 100644
--- a/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsgridview.cpp
@@ -51,63 +51,6 @@
QT_BEGIN_NAMESPACE
-class QmlGraphicsGridViewAttached : public QObject
-{
- Q_OBJECT
-public:
- QmlGraphicsGridViewAttached(QObject *parent)
- : QObject(parent), m_isCurrent(false), m_delayRemove(false) {}
- ~QmlGraphicsGridViewAttached() {
- attachedProperties.remove(parent());
- }
-
- Q_PROPERTY(QmlGraphicsGridView *view READ view CONSTANT)
- QmlGraphicsGridView *view() { return m_view; }
-
- Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
- bool isCurrentItem() const { return m_isCurrent; }
- void setIsCurrentItem(bool c) {
- if (m_isCurrent != c) {
- m_isCurrent = c;
- emit currentItemChanged();
- }
- }
-
- Q_PROPERTY(bool delayRemove READ delayRemove WRITE setDelayRemove NOTIFY delayRemoveChanged)
- bool delayRemove() const { return m_delayRemove; }
- void setDelayRemove(bool delay) {
- if (m_delayRemove != delay) {
- m_delayRemove = delay;
- emit delayRemoveChanged();
- }
- }
-
- static QmlGraphicsGridViewAttached *properties(QObject *obj) {
- QmlGraphicsGridViewAttached *rv = attachedProperties.value(obj);
- if (!rv) {
- rv = new QmlGraphicsGridViewAttached(obj);
- attachedProperties.insert(obj, rv);
- }
- return rv;
- }
-
- void emitAdd() { emit add(); }
- void emitRemove() { emit remove(); }
-
-Q_SIGNALS:
- void currentItemChanged();
- void delayRemoveChanged();
- void add();
- void remove();
-
-public:
- QmlGraphicsGridView *m_view;
- bool m_isCurrent;
- bool m_delayRemove;
-
- static QHash<QObject*, QmlGraphicsGridViewAttached*> attachedProperties;
-};
-
QHash<QObject*, QmlGraphicsGridViewAttached*> QmlGraphicsGridViewAttached::attachedProperties;
@@ -1754,8 +1697,4 @@ QmlGraphicsGridViewAttached *QmlGraphicsGridView::qmlAttachedProperties(QObject
return QmlGraphicsGridViewAttached::properties(obj);
}
-QML_DEFINE_TYPE(Qt, 4,6, GridView, QmlGraphicsGridView)
-
QT_END_NAMESPACE
-
-#include <qmlgraphicsgridview.moc>
diff --git a/src/declarative/graphicsitems/qmlgraphicsgridview_p.h b/src/declarative/graphicsitems/qmlgraphicsgridview_p.h
index d2ef70e..25a76a3 100644
--- a/src/declarative/graphicsitems/qmlgraphicsgridview_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsgridview_p.h
@@ -154,6 +154,64 @@ private:
void refill();
};
+class QmlGraphicsGridViewAttached : public QObject
+{
+ Q_OBJECT
+public:
+ QmlGraphicsGridViewAttached(QObject *parent)
+ : QObject(parent), m_isCurrent(false), m_delayRemove(false) {}
+ ~QmlGraphicsGridViewAttached() {
+ attachedProperties.remove(parent());
+ }
+
+ Q_PROPERTY(QmlGraphicsGridView *view READ view CONSTANT)
+ QmlGraphicsGridView *view() { return m_view; }
+
+ Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
+ bool isCurrentItem() const { return m_isCurrent; }
+ void setIsCurrentItem(bool c) {
+ if (m_isCurrent != c) {
+ m_isCurrent = c;
+ emit currentItemChanged();
+ }
+ }
+
+ Q_PROPERTY(bool delayRemove READ delayRemove WRITE setDelayRemove NOTIFY delayRemoveChanged)
+ bool delayRemove() const { return m_delayRemove; }
+ void setDelayRemove(bool delay) {
+ if (m_delayRemove != delay) {
+ m_delayRemove = delay;
+ emit delayRemoveChanged();
+ }
+ }
+
+ static QmlGraphicsGridViewAttached *properties(QObject *obj) {
+ QmlGraphicsGridViewAttached *rv = attachedProperties.value(obj);
+ if (!rv) {
+ rv = new QmlGraphicsGridViewAttached(obj);
+ attachedProperties.insert(obj, rv);
+ }
+ return rv;
+ }
+
+ void emitAdd() { emit add(); }
+ void emitRemove() { emit remove(); }
+
+Q_SIGNALS:
+ void currentItemChanged();
+ void delayRemoveChanged();
+ void add();
+ void remove();
+
+public:
+ QmlGraphicsGridView *m_view;
+ bool m_isCurrent;
+ bool m_delayRemove;
+
+ static QHash<QObject*, QmlGraphicsGridViewAttached*> attachedProperties;
+};
+
+
QT_END_NAMESPACE
QML_DECLARE_TYPE(QmlGraphicsGridView)
diff --git a/src/declarative/graphicsitems/qmlgraphicsimage.cpp b/src/declarative/graphicsitems/qmlgraphicsimage.cpp
index 7e63c8b..558511d 100644
--- a/src/declarative/graphicsitems/qmlgraphicsimage.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsimage.cpp
@@ -48,8 +48,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,Image,QmlGraphicsImage)
-
/*!
\qmlclass Image QmlGraphicsImage
\brief The Image element allows you to add bitmaps to a scene.
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.cpp b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
index 8973cb4..9fd8702 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsitem.cpp
@@ -69,12 +69,6 @@ QT_BEGIN_NAMESPACE
#define FLT_MAX 1E+37
#endif
-QML_DEFINE_TYPE(Qt,4,6,Item,QmlGraphicsItem)
-
-QML_DEFINE_NOCREATE_TYPE(QGraphicsTransform);
-QML_DEFINE_TYPE(Qt,4,6,Scale,QGraphicsScale)
-QML_DEFINE_TYPE(Qt,4,6,Rotation,QGraphicsRotation)
-
#include "qmlgraphicseffects.cpp"
/*!
@@ -325,28 +319,6 @@ void QmlGraphicsContents::setItem(QmlGraphicsItem *item)
calcWidth();
}
-/*
- Key filters can be installed on a QmlGraphicsItem, but not removed. Currently they
- are only used by attached objects (which are only destroyed on Item
- destruction), so this isn't a problem. If in future this becomes any form
- of public API, they will have to support removal too.
-*/
-class QmlGraphicsItemKeyFilter
-{
-public:
- QmlGraphicsItemKeyFilter(QmlGraphicsItem * = 0);
- virtual ~QmlGraphicsItemKeyFilter();
-
- virtual void keyPressed(QKeyEvent *event);
- virtual void keyReleased(QKeyEvent *event);
- virtual void inputMethodEvent(QInputMethodEvent *event);
- virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
- virtual void componentComplete();
-
-private:
- QmlGraphicsItemKeyFilter *m_next;
-};
-
QmlGraphicsItemKeyFilter::QmlGraphicsItemKeyFilter(QmlGraphicsItem *item)
: m_next(0)
{
@@ -458,49 +430,6 @@ void QmlGraphicsItemKeyFilter::componentComplete()
pressed.
*/
-class QmlGraphicsKeyNavigationAttachedPrivate : public QObjectPrivate
-{
-public:
- QmlGraphicsKeyNavigationAttachedPrivate()
- : QObjectPrivate(), left(0), right(0), up(0), down(0) {}
-
- QmlGraphicsItem *left;
- QmlGraphicsItem *right;
- QmlGraphicsItem *up;
- QmlGraphicsItem *down;
-};
-
-class QmlGraphicsKeyNavigationAttached : public QObject, public QmlGraphicsItemKeyFilter
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QmlGraphicsKeyNavigationAttached)
-
- Q_PROPERTY(QmlGraphicsItem *left READ left WRITE setLeft NOTIFY changed)
- Q_PROPERTY(QmlGraphicsItem *right READ right WRITE setRight NOTIFY changed)
- Q_PROPERTY(QmlGraphicsItem *up READ up WRITE setUp NOTIFY changed)
- Q_PROPERTY(QmlGraphicsItem *down READ down WRITE setDown NOTIFY changed)
-public:
- QmlGraphicsKeyNavigationAttached(QObject * = 0);
-
- QmlGraphicsItem *left() const;
- void setLeft(QmlGraphicsItem *);
- QmlGraphicsItem *right() const;
- void setRight(QmlGraphicsItem *);
- QmlGraphicsItem *up() const;
- void setUp(QmlGraphicsItem *);
- QmlGraphicsItem *down() const;
- void setDown(QmlGraphicsItem *);
-
- static QmlGraphicsKeyNavigationAttached *qmlAttachedProperties(QObject *);
-
-Q_SIGNALS:
- void changed();
-
-private:
- virtual void keyPressed(QKeyEvent *event);
- virtual void keyReleased(QKeyEvent *event);
-};
-
QmlGraphicsKeyNavigationAttached::QmlGraphicsKeyNavigationAttached(QObject *parent)
: QObject(*(new QmlGraphicsKeyNavigationAttachedPrivate), parent),
QmlGraphicsItemKeyFilter(qobject_cast<QmlGraphicsItem*>(parent))
@@ -964,137 +893,6 @@ void QmlGraphicsKeyNavigationAttached::keyReleased(QKeyEvent *event)
*/
-class QmlGraphicsKeysAttachedPrivate : public QObjectPrivate
-{
-public:
- QmlGraphicsKeysAttachedPrivate()
- : QObjectPrivate(), inPress(false), inRelease(false)
- , inIM(false), enabled(true), imeItem(0), item(0)
- {}
-
- bool isConnected(const char *signalName);
-
- QGraphicsItem *finalFocusProxy(QGraphicsItem *item) const
- {
- QGraphicsItem *fp;
- while ((fp = item->focusProxy()))
- item = fp;
- return item;
- }
-
- //loop detection
- bool inPress:1;
- bool inRelease:1;
- bool inIM:1;
-
- bool enabled : 1;
-
- QGraphicsItem *imeItem;
- QList<QmlGraphicsItem *> targets;
- QmlGraphicsItem *item;
-};
-
-class QmlGraphicsKeysAttached : public QObject, public QmlGraphicsItemKeyFilter
-{
- Q_OBJECT
- Q_DECLARE_PRIVATE(QmlGraphicsKeysAttached)
-
- Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
- Q_PROPERTY(QList<QmlGraphicsItem *> *forwardTo READ forwardTo)
-
-public:
- QmlGraphicsKeysAttached(QObject *parent=0);
- ~QmlGraphicsKeysAttached();
-
- bool enabled() const { Q_D(const QmlGraphicsKeysAttached); return d->enabled; }
- void setEnabled(bool enabled) {
- Q_D(QmlGraphicsKeysAttached);
- if (enabled != d->enabled) {
- d->enabled = enabled;
- emit enabledChanged();
- }
- }
-
- QList<QmlGraphicsItem *> *forwardTo() {
- Q_D(QmlGraphicsKeysAttached);
- return &d->targets;
- }
-
- virtual void componentComplete();
-
- static QmlGraphicsKeysAttached *qmlAttachedProperties(QObject *);
-
-Q_SIGNALS:
- void enabledChanged();
- void pressed(QmlGraphicsKeyEvent *event);
- void released(QmlGraphicsKeyEvent *event);
- void digit0Pressed(QmlGraphicsKeyEvent *event);
- void digit1Pressed(QmlGraphicsKeyEvent *event);
- void digit2Pressed(QmlGraphicsKeyEvent *event);
- void digit3Pressed(QmlGraphicsKeyEvent *event);
- void digit4Pressed(QmlGraphicsKeyEvent *event);
- void digit5Pressed(QmlGraphicsKeyEvent *event);
- void digit6Pressed(QmlGraphicsKeyEvent *event);
- void digit7Pressed(QmlGraphicsKeyEvent *event);
- void digit8Pressed(QmlGraphicsKeyEvent *event);
- void digit9Pressed(QmlGraphicsKeyEvent *event);
-
- void leftPressed(QmlGraphicsKeyEvent *event);
- void rightPressed(QmlGraphicsKeyEvent *event);
- void upPressed(QmlGraphicsKeyEvent *event);
- void downPressed(QmlGraphicsKeyEvent *event);
-
- void asteriskPressed(QmlGraphicsKeyEvent *event);
- void numberSignPressed(QmlGraphicsKeyEvent *event);
- void escapePressed(QmlGraphicsKeyEvent *event);
- void returnPressed(QmlGraphicsKeyEvent *event);
- void enterPressed(QmlGraphicsKeyEvent *event);
- void deletePressed(QmlGraphicsKeyEvent *event);
- void spacePressed(QmlGraphicsKeyEvent *event);
- void backPressed(QmlGraphicsKeyEvent *event);
- void cancelPressed(QmlGraphicsKeyEvent *event);
- void selectPressed(QmlGraphicsKeyEvent *event);
- void yesPressed(QmlGraphicsKeyEvent *event);
- void noPressed(QmlGraphicsKeyEvent *event);
- void context1Pressed(QmlGraphicsKeyEvent *event);
- void context2Pressed(QmlGraphicsKeyEvent *event);
- void context3Pressed(QmlGraphicsKeyEvent *event);
- void context4Pressed(QmlGraphicsKeyEvent *event);
- void callPressed(QmlGraphicsKeyEvent *event);
- void hangupPressed(QmlGraphicsKeyEvent *event);
- void flipPressed(QmlGraphicsKeyEvent *event);
- void menuPressed(QmlGraphicsKeyEvent *event);
- void volumeUpPressed(QmlGraphicsKeyEvent *event);
- void volumeDownPressed(QmlGraphicsKeyEvent *event);
-
-private:
- virtual void keyPressed(QKeyEvent *event);
- virtual void keyReleased(QKeyEvent *event);
- virtual void inputMethodEvent(QInputMethodEvent *);
- virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
-
- const QByteArray keyToSignal(int key) {
- QByteArray keySignal;
- if (key >= Qt::Key_0 && key <= Qt::Key_9) {
- keySignal = "digit0Pressed";
- keySignal[5] = '0' + (key - Qt::Key_0);
- } else {
- int i = 0;
- while (sigMap[i].key && sigMap[i].key != key)
- ++i;
- keySignal = sigMap[i].sig;
- }
- return keySignal;
- }
-
- struct SigMap {
- int key;
- const char *sig;
- };
-
- static const SigMap sigMap[];
-};
-
const QmlGraphicsKeysAttached::SigMap QmlGraphicsKeysAttached::sigMap[] = {
{ Qt::Key_Left, "leftPressed" },
{ Qt::Key_Right, "rightPressed" },
@@ -3086,14 +2884,6 @@ int QmlGraphicsItemPrivate::restart(QTime &t)
return n;
}
-#include <qmlgraphicsitem.moc>
#include <moc_qmlgraphicsitem.cpp>
QT_END_NAMESPACE
-
-QML_DECLARE_TYPE(QmlGraphicsKeysAttached)
-QML_DECLARE_TYPEINFO(QmlGraphicsKeysAttached, QML_HAS_ATTACHED_PROPERTIES)
-QML_DEFINE_TYPE(Qt,4,6,Keys,QmlGraphicsKeysAttached)
-QML_DECLARE_TYPE(QmlGraphicsKeyNavigationAttached)
-QML_DECLARE_TYPEINFO(QmlGraphicsKeyNavigationAttached, QML_HAS_ATTACHED_PROPERTIES)
-QML_DEFINE_TYPE(Qt,4,6,KeyNavigation,QmlGraphicsKeyNavigationAttached)
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem.h b/src/declarative/graphicsitems/qmlgraphicsitem.h
index 8ae2d5c..e0f33c7 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem.h
+++ b/src/declarative/graphicsitems/qmlgraphicsitem.h
@@ -50,6 +50,7 @@
#include <QtGui/qgraphicsitem.h>
#include <QtGui/qgraphicstransform.h>
#include <QtGui/qfont.h>
+#include <QtGui/qaction.h>
QT_BEGIN_HEADER
@@ -233,6 +234,7 @@ QML_DECLARE_TYPE(QmlGraphicsItem)
QML_DECLARE_TYPE(QGraphicsTransform)
QML_DECLARE_TYPE(QGraphicsScale)
QML_DECLARE_TYPE(QGraphicsRotation)
+QML_DECLARE_TYPE(QAction)
QT_END_HEADER
diff --git a/src/declarative/graphicsitems/qmlgraphicsitem_p.h b/src/declarative/graphicsitems/qmlgraphicsitem_p.h
index 1741808..9a77dbb 100644
--- a/src/declarative/graphicsitems/qmlgraphicsitem_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsitem_p.h
@@ -280,8 +280,209 @@ public:
static int restart(QTime &);
};
+/*
+ Key filters can be installed on a QmlGraphicsItem, but not removed. Currently they
+ are only used by attached objects (which are only destroyed on Item
+ destruction), so this isn't a problem. If in future this becomes any form
+ of public API, they will have to support removal too.
+*/
+class QmlGraphicsItemKeyFilter
+{
+public:
+ QmlGraphicsItemKeyFilter(QmlGraphicsItem * = 0);
+ virtual ~QmlGraphicsItemKeyFilter();
+
+ virtual void keyPressed(QKeyEvent *event);
+ virtual void keyReleased(QKeyEvent *event);
+ virtual void inputMethodEvent(QInputMethodEvent *event);
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+ virtual void componentComplete();
+
+private:
+ QmlGraphicsItemKeyFilter *m_next;
+};
+
+class QmlGraphicsKeyNavigationAttachedPrivate : public QObjectPrivate
+{
+public:
+ QmlGraphicsKeyNavigationAttachedPrivate()
+ : QObjectPrivate(), left(0), right(0), up(0), down(0) {}
+
+ QmlGraphicsItem *left;
+ QmlGraphicsItem *right;
+ QmlGraphicsItem *up;
+ QmlGraphicsItem *down;
+};
+
+class QmlGraphicsKeyNavigationAttached : public QObject, public QmlGraphicsItemKeyFilter
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QmlGraphicsKeyNavigationAttached)
+
+ Q_PROPERTY(QmlGraphicsItem *left READ left WRITE setLeft NOTIFY changed)
+ Q_PROPERTY(QmlGraphicsItem *right READ right WRITE setRight NOTIFY changed)
+ Q_PROPERTY(QmlGraphicsItem *up READ up WRITE setUp NOTIFY changed)
+ Q_PROPERTY(QmlGraphicsItem *down READ down WRITE setDown NOTIFY changed)
+public:
+ QmlGraphicsKeyNavigationAttached(QObject * = 0);
+
+ QmlGraphicsItem *left() const;
+ void setLeft(QmlGraphicsItem *);
+ QmlGraphicsItem *right() const;
+ void setRight(QmlGraphicsItem *);
+ QmlGraphicsItem *up() const;
+ void setUp(QmlGraphicsItem *);
+ QmlGraphicsItem *down() const;
+ void setDown(QmlGraphicsItem *);
+
+ static QmlGraphicsKeyNavigationAttached *qmlAttachedProperties(QObject *);
+
+Q_SIGNALS:
+ void changed();
+
+private:
+ virtual void keyPressed(QKeyEvent *event);
+ virtual void keyReleased(QKeyEvent *event);
+};
+
+class QmlGraphicsKeysAttachedPrivate : public QObjectPrivate
+{
+public:
+ QmlGraphicsKeysAttachedPrivate()
+ : QObjectPrivate(), inPress(false), inRelease(false)
+ , inIM(false), enabled(true), imeItem(0), item(0)
+ {}
+
+ bool isConnected(const char *signalName);
+
+ QGraphicsItem *finalFocusProxy(QGraphicsItem *item) const
+ {
+ QGraphicsItem *fp;
+ while ((fp = item->focusProxy()))
+ item = fp;
+ return item;
+ }
+
+ //loop detection
+ bool inPress:1;
+ bool inRelease:1;
+ bool inIM:1;
+
+ bool enabled : 1;
+
+ QGraphicsItem *imeItem;
+ QList<QmlGraphicsItem *> targets;
+ QmlGraphicsItem *item;
+};
+
+class QmlGraphicsKeysAttached : public QObject, public QmlGraphicsItemKeyFilter
+{
+ Q_OBJECT
+ Q_DECLARE_PRIVATE(QmlGraphicsKeysAttached)
+
+ Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
+ Q_PROPERTY(QList<QmlGraphicsItem *> *forwardTo READ forwardTo)
+
+public:
+ QmlGraphicsKeysAttached(QObject *parent=0);
+ ~QmlGraphicsKeysAttached();
+
+ bool enabled() const { Q_D(const QmlGraphicsKeysAttached); return d->enabled; }
+ void setEnabled(bool enabled) {
+ Q_D(QmlGraphicsKeysAttached);
+ if (enabled != d->enabled) {
+ d->enabled = enabled;
+ emit enabledChanged();
+ }
+ }
+
+ QList<QmlGraphicsItem *> *forwardTo() {
+ Q_D(QmlGraphicsKeysAttached);
+ return &d->targets;
+ }
+
+ virtual void componentComplete();
+
+ static QmlGraphicsKeysAttached *qmlAttachedProperties(QObject *);
+
+Q_SIGNALS:
+ void enabledChanged();
+ void pressed(QmlGraphicsKeyEvent *event);
+ void released(QmlGraphicsKeyEvent *event);
+ void digit0Pressed(QmlGraphicsKeyEvent *event);
+ void digit1Pressed(QmlGraphicsKeyEvent *event);
+ void digit2Pressed(QmlGraphicsKeyEvent *event);
+ void digit3Pressed(QmlGraphicsKeyEvent *event);
+ void digit4Pressed(QmlGraphicsKeyEvent *event);
+ void digit5Pressed(QmlGraphicsKeyEvent *event);
+ void digit6Pressed(QmlGraphicsKeyEvent *event);
+ void digit7Pressed(QmlGraphicsKeyEvent *event);
+ void digit8Pressed(QmlGraphicsKeyEvent *event);
+ void digit9Pressed(QmlGraphicsKeyEvent *event);
+
+ void leftPressed(QmlGraphicsKeyEvent *event);
+ void rightPressed(QmlGraphicsKeyEvent *event);
+ void upPressed(QmlGraphicsKeyEvent *event);
+ void downPressed(QmlGraphicsKeyEvent *event);
+
+ void asteriskPressed(QmlGraphicsKeyEvent *event);
+ void numberSignPressed(QmlGraphicsKeyEvent *event);
+ void escapePressed(QmlGraphicsKeyEvent *event);
+ void returnPressed(QmlGraphicsKeyEvent *event);
+ void enterPressed(QmlGraphicsKeyEvent *event);
+ void deletePressed(QmlGraphicsKeyEvent *event);
+ void spacePressed(QmlGraphicsKeyEvent *event);
+ void backPressed(QmlGraphicsKeyEvent *event);
+ void cancelPressed(QmlGraphicsKeyEvent *event);
+ void selectPressed(QmlGraphicsKeyEvent *event);
+ void yesPressed(QmlGraphicsKeyEvent *event);
+ void noPressed(QmlGraphicsKeyEvent *event);
+ void context1Pressed(QmlGraphicsKeyEvent *event);
+ void context2Pressed(QmlGraphicsKeyEvent *event);
+ void context3Pressed(QmlGraphicsKeyEvent *event);
+ void context4Pressed(QmlGraphicsKeyEvent *event);
+ void callPressed(QmlGraphicsKeyEvent *event);
+ void hangupPressed(QmlGraphicsKeyEvent *event);
+ void flipPressed(QmlGraphicsKeyEvent *event);
+ void menuPressed(QmlGraphicsKeyEvent *event);
+ void volumeUpPressed(QmlGraphicsKeyEvent *event);
+ void volumeDownPressed(QmlGraphicsKeyEvent *event);
+
+private:
+ virtual void keyPressed(QKeyEvent *event);
+ virtual void keyReleased(QKeyEvent *event);
+ virtual void inputMethodEvent(QInputMethodEvent *);
+ virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const;
+
+ const QByteArray keyToSignal(int key) {
+ QByteArray keySignal;
+ if (key >= Qt::Key_0 && key <= Qt::Key_9) {
+ keySignal = "digit0Pressed";
+ keySignal[5] = '0' + (key - Qt::Key_0);
+ } else {
+ int i = 0;
+ while (sigMap[i].key && sigMap[i].key != key)
+ ++i;
+ keySignal = sigMap[i].sig;
+ }
+ return keySignal;
+ }
+
+ struct SigMap {
+ int key;
+ const char *sig;
+ };
+
+ static const SigMap sigMap[];
+};
+
Q_DECLARE_OPERATORS_FOR_FLAGS(QmlGraphicsItemPrivate::ChangeTypes);
QT_END_NAMESPACE
+QML_DECLARE_TYPE(QmlGraphicsKeysAttached)
+QML_DECLARE_TYPEINFO(QmlGraphicsKeysAttached, QML_HAS_ATTACHED_PROPERTIES)
+QML_DECLARE_TYPE(QmlGraphicsKeyNavigationAttached)
+QML_DECLARE_TYPEINFO(QmlGraphicsKeyNavigationAttached, QML_HAS_ATTACHED_PROPERTIES)
+
#endif // QMLGRAPHICSITEM_P_H
diff --git a/src/declarative/graphicsitems/qmlgraphicsitemsmodule.cpp b/src/declarative/graphicsitems/qmlgraphicsitemsmodule.cpp
new file mode 100644
index 0000000..127aec8
--- /dev/null
+++ b/src/declarative/graphicsitems/qmlgraphicsitemsmodule.cpp
@@ -0,0 +1,164 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 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$
+**
+****************************************************************************/
+
+#include "qmlgraphicsitemsmodule_p.h"
+
+#include <QtGui/qaction.h>
+#include <QtGui/qvalidator.h>
+#include <QtGui/qgraphicseffect.h>
+
+#include "qmlgraphicsevents_p_p.h"
+#include "qmlgraphicseffects_p.h"
+#include "qmlgraphicsscalegrid_p_p.h"
+#include "qmlgraphicsanimatedimage_p.h"
+#include "qmlgraphicsborderimage_p.h"
+#include "qmlgraphicspositioners_p.h"
+#include "qmlgraphicsmouseregion_p.h"
+#include "qmlgraphicsflickable_p.h"
+#include "qmlgraphicsflickable_p_p.h"
+#include "qmlgraphicsflipable_p.h"
+#include "qmlgraphicsfocuspanel_p.h"
+#include "qmlgraphicsfocusscope_p.h"
+#include "qmlgraphicsgraphicsobjectcontainer_p.h"
+#include "qmlgraphicsgridview_p.h"
+#include "qmlgraphicsimage_p.h"
+#include "qmlgraphicsitem_p.h"
+#include "qmlgraphicslayoutitem_p.h"
+#include "qmlgraphicslistview_p.h"
+#include "qmlgraphicsloader_p.h"
+#include "qmlgraphicsmouseregion_p.h"
+#include "qmlgraphicsparticles_p.h"
+#include "qmlgraphicspath_p.h"
+#include "qmlgraphicspathview_p.h"
+#include "qmlgraphicsrectangle_p.h"
+#include "qmlgraphicsrepeater_p.h"
+#include "qmlgraphicstext_p.h"
+#include "qmlgraphicstextedit_p.h"
+#include "qmlgraphicstextinput_p.h"
+#include "qmlgraphicsvisualitemmodel_p.h"
+#ifdef QT_WEBKIT_LIB
+#include "qmlgraphicswebview_p.h"
+#include "qmlgraphicswebview_p_p.h"
+#endif
+#include "qmlgraphicsanchors_p.h"
+
+#define QML_REGISTER_TYPE(URI,VMAJ,VMIN,TYPE,CLASS) \
+ qmlRegisterType<CLASS>(#URI, VMAJ, VMIN, #TYPE, #CLASS)
+
+#define QML_REGISTER_NOCREATE_TYPE(CLASS) \
+ qmlRegisterType<CLASS>(#CLASS)
+
+void QmlGraphicsItemModule::defineModule()
+{
+ QML_REGISTER_TYPE(Qt,4,6,AnimatedImage,QmlGraphicsAnimatedImage);
+ QML_REGISTER_TYPE(Qt,4,6,Blur,QGraphicsBlurEffect);
+ QML_REGISTER_TYPE(Qt,4,6,BorderImage,QmlGraphicsBorderImage);
+ QML_REGISTER_TYPE(Qt,4,6,Colorize,QGraphicsColorizeEffect);
+ QML_REGISTER_TYPE(Qt,4,6,Column,QmlGraphicsColumn);
+ QML_REGISTER_TYPE(Qt,4,6,Drag,QmlGraphicsDrag);
+ QML_REGISTER_TYPE(Qt,4,6,DropShadow,QGraphicsDropShadowEffect);
+ QML_REGISTER_TYPE(Qt,4,6,Flickable,QmlGraphicsFlickable);
+ QML_REGISTER_TYPE(Qt,4,6,Flipable,QmlGraphicsFlipable);
+ QML_REGISTER_TYPE(Qt,4,6,Flow,QmlGraphicsFlow);
+ QML_REGISTER_TYPE(Qt,4,6,FocusPanel,QmlGraphicsFocusPanel);
+ QML_REGISTER_TYPE(Qt,4,6,FocusScope,QmlGraphicsFocusScope);
+ QML_REGISTER_TYPE(Qt,4,6,Gradient,QmlGraphicsGradient);
+ QML_REGISTER_TYPE(Qt,4,6,GradientStop,QmlGraphicsGradientStop);
+ QML_REGISTER_TYPE(Qt,4,6,GraphicsObjectContainer,QmlGraphicsGraphicsObjectContainer);
+ QML_REGISTER_TYPE(Qt,4,6,Grid,QmlGraphicsGrid);
+ QML_REGISTER_TYPE(Qt,4,6,GridView,QmlGraphicsGridView);
+ QML_REGISTER_TYPE(Qt,4,6,Image,QmlGraphicsImage);
+ QML_REGISTER_TYPE(Qt,4,6,Item,QmlGraphicsItem);
+ QML_REGISTER_TYPE(Qt,4,6,KeyNavigation,QmlGraphicsKeyNavigationAttached);
+ QML_REGISTER_TYPE(Qt,4,6,Keys,QmlGraphicsKeysAttached);
+ QML_REGISTER_TYPE(Qt,4,6,LayoutItem,QmlGraphicsLayoutItem);
+ QML_REGISTER_TYPE(Qt,4,6,ListView,QmlGraphicsListView);
+ QML_REGISTER_TYPE(Qt,4,6,Loader,QmlGraphicsLoader);
+ QML_REGISTER_TYPE(Qt,4,6,MouseRegion,QmlGraphicsMouseRegion);
+ QML_REGISTER_TYPE(Qt,4,6,Opacity,QGraphicsOpacityEffect);
+ QML_REGISTER_TYPE(Qt,4,6,ParticleMotion,QmlGraphicsParticleMotion);
+ QML_REGISTER_TYPE(Qt,4,6,ParticleMotionGravity,QmlGraphicsParticleMotionGravity);
+ QML_REGISTER_TYPE(Qt,4,6,ParticleMotionLinear,QmlGraphicsParticleMotionLinear);
+ QML_REGISTER_TYPE(Qt,4,6,ParticleMotionWander,QmlGraphicsParticleMotionWander);
+ QML_REGISTER_TYPE(Qt,4,6,Particles,QmlGraphicsParticles);
+ QML_REGISTER_TYPE(Qt,4,6,Path,QmlGraphicsPath);
+ QML_REGISTER_TYPE(Qt,4,6,PathAttribute,QmlGraphicsPathAttribute);
+ QML_REGISTER_TYPE(Qt,4,6,PathCubic,QmlGraphicsPathCubic);
+ QML_REGISTER_TYPE(Qt,4,6,PathLine,QmlGraphicsPathLine);
+ QML_REGISTER_TYPE(Qt,4,6,PathPercent,QmlGraphicsPathPercent);
+ QML_REGISTER_TYPE(Qt,4,6,PathQuad,QmlGraphicsPathQuad);
+ QML_REGISTER_TYPE(Qt,4,6,PathView,QmlGraphicsPathView);
+ QML_REGISTER_TYPE(Qt,4,6,Pen,QmlGraphicsPen);
+ QML_REGISTER_TYPE(Qt,4,6,QDoubleValidator,QDoubleValidator);
+ QML_REGISTER_TYPE(Qt,4,6,QIntValidator,QIntValidator);
+ QML_REGISTER_TYPE(Qt,4,6,QRegExpValidator,QRegExpValidator);
+ QML_REGISTER_TYPE(Qt,4,6,Rectangle,QmlGraphicsRectangle);
+ QML_REGISTER_TYPE(Qt,4,6,Repeater,QmlGraphicsRepeater);
+ QML_REGISTER_TYPE(Qt,4,6,Rotation,QGraphicsRotation);
+ QML_REGISTER_TYPE(Qt,4,6,Row,QmlGraphicsRow);
+ QML_REGISTER_TYPE(Qt,4,6,Scale,QGraphicsScale);
+ QML_REGISTER_TYPE(Qt,4,6,Text,QmlGraphicsText);
+ QML_REGISTER_TYPE(Qt,4,6,TextEdit,QmlGraphicsTextEdit);
+ QML_REGISTER_TYPE(Qt,4,6,TextInput,QmlGraphicsTextInput);
+ QML_REGISTER_TYPE(Qt,4,6,ViewSection,QmlGraphicsViewSection);
+ QML_REGISTER_TYPE(Qt,4,6,VisibleArea,QmlGraphicsFlickableVisibleArea);
+ QML_REGISTER_TYPE(Qt,4,6,VisualDataModel,QmlGraphicsVisualDataModel);
+ QML_REGISTER_TYPE(Qt,4,6,VisualItemModel,QmlGraphicsVisualItemModel);
+#ifdef QT_WEBKIT_LIB
+ QML_REGISTER_TYPE(Qt,4,6,WebView,QmlGraphicsWebView);
+#endif
+
+ QML_REGISTER_NOCREATE_TYPE(QmlGraphicsAnchors);
+ QML_REGISTER_NOCREATE_TYPE(QGraphicsEffect);
+ QML_REGISTER_NOCREATE_TYPE(QmlGraphicsKeyEvent);
+ QML_REGISTER_NOCREATE_TYPE(QmlGraphicsMouseEvent);
+ QML_REGISTER_NOCREATE_TYPE(QGraphicsObject);
+ QML_REGISTER_NOCREATE_TYPE(QGraphicsTransform);
+ QML_REGISTER_NOCREATE_TYPE(QmlGraphicsPathElement);
+ QML_REGISTER_NOCREATE_TYPE(QmlGraphicsCurve);
+ QML_REGISTER_NOCREATE_TYPE(QmlGraphicsScaleGrid);
+ QML_REGISTER_NOCREATE_TYPE(QValidator);
+ QML_REGISTER_NOCREATE_TYPE(QmlGraphicsVisualModel);
+ QML_REGISTER_NOCREATE_TYPE(QAction);
+#ifdef QT_WEBKIT_LIB
+ QML_REGISTER_NOCREATE_TYPE(QmlGraphicsWebSettings);
+#endif
+}
diff --git a/src/declarative/graphicsitems/qmlgraphicsitemsmodule_p.h b/src/declarative/graphicsitems/qmlgraphicsitemsmodule_p.h
new file mode 100644
index 0000000..bf38c24
--- /dev/null
+++ b/src/declarative/graphicsitems/qmlgraphicsitemsmodule_p.h
@@ -0,0 +1,63 @@
+/****************************************************************************
+**
+** Copyright (C) 2009 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 QMLGRAPHICSITEMMODULE_H
+#define QMLGRAPHICSITEMMODULE_H
+
+#include <qml.h>
+
+QT_BEGIN_HEADER
+
+QT_BEGIN_NAMESPACE
+
+QT_MODULE(Declarative)
+
+class QmlGraphicsItemModule
+{
+public:
+ static void defineModule();
+};
+
+QT_END_NAMESPACE
+
+QT_END_HEADER
+
+#endif // QMLGRAPHICSITEMMODULE_H
diff --git a/src/declarative/graphicsitems/qmlgraphicslayoutitem.cpp b/src/declarative/graphicsitems/qmlgraphicslayoutitem.cpp
index 7227eb0..98361dc 100644
--- a/src/declarative/graphicsitems/qmlgraphicslayoutitem.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicslayoutitem.cpp
@@ -47,8 +47,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,LayoutItem,QmlGraphicsLayoutItem)
-
/*!
\qmlclass LayoutItem QmlGraphicsLayoutItem
\brief The LayoutItem element allows you to place your Fluid UI elements inside a classical Qt layout.
diff --git a/src/declarative/graphicsitems/qmlgraphicslistview.cpp b/src/declarative/graphicsitems/qmlgraphicslistview.cpp
index d0b3739..db0afe1 100644
--- a/src/declarative/graphicsitems/qmlgraphicslistview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicslistview.cpp
@@ -85,72 +85,6 @@ QString QmlGraphicsViewSection::sectionString(const QString &value)
return value;
}
-class QmlGraphicsListViewAttached : public QObject
-{
- Q_OBJECT
-public:
- QmlGraphicsListViewAttached(QObject *parent)
- : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
- ~QmlGraphicsListViewAttached() {}
-
- Q_PROPERTY(QmlGraphicsListView *view READ view CONSTANT)
- QmlGraphicsListView *view() { return m_view; }
-
- Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
- bool isCurrentItem() const { return m_isCurrent; }
- void setIsCurrentItem(bool c) {
- if (m_isCurrent != c) {
- m_isCurrent = c;
- emit currentItemChanged();
- }
- }
-
- Q_PROPERTY(QString prevSection READ prevSection NOTIFY prevSectionChanged)
- QString prevSection() const { return m_prevSection; }
- void setPrevSection(const QString &sect) {
- if (m_prevSection != sect) {
- m_prevSection = sect;
- emit prevSectionChanged();
- }
- }
-
- Q_PROPERTY(QString section READ section NOTIFY sectionChanged)
- QString section() const { return m_section; }
- void setSection(const QString &sect) {
- if (m_section != sect) {
- m_section = sect;
- emit sectionChanged();
- }
- }
-
- Q_PROPERTY(bool delayRemove READ delayRemove WRITE setDelayRemove NOTIFY delayRemoveChanged)
- bool delayRemove() const { return m_delayRemove; }
- void setDelayRemove(bool delay) {
- if (m_delayRemove != delay) {
- m_delayRemove = delay;
- emit delayRemoveChanged();
- }
- }
-
- void emitAdd() { emit add(); }
- void emitRemove() { emit remove(); }
-
-Q_SIGNALS:
- void currentItemChanged();
- void sectionChanged();
- void prevSectionChanged();
- void delayRemoveChanged();
- void add();
- void remove();
-
-public:
- QmlGraphicsListView *m_view;
- bool m_isCurrent;
- mutable QString m_section;
- QString m_prevSection;
- bool m_delayRemove;
-};
-
//----------------------------------------------------------------------------
class FxListItem
@@ -2740,9 +2674,4 @@ QmlGraphicsListViewAttached *QmlGraphicsListView::qmlAttachedProperties(QObject
return new QmlGraphicsListViewAttached(obj);
}
-QML_DEFINE_TYPE(Qt,4,6,ListView,QmlGraphicsListView)
-QML_DEFINE_TYPE(Qt,4,6,ViewSection,QmlGraphicsViewSection)
-
QT_END_NAMESPACE
-
-#include <qmlgraphicslistview.moc>
diff --git a/src/declarative/graphicsitems/qmlgraphicslistview_p.h b/src/declarative/graphicsitems/qmlgraphicslistview_p.h
index 79d678a..42ace15 100644
--- a/src/declarative/graphicsitems/qmlgraphicslistview_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicslistview_p.h
@@ -227,6 +227,73 @@ private Q_SLOTS:
void animStopped();
};
+class QmlGraphicsListViewAttached : public QObject
+{
+ Q_OBJECT
+public:
+ QmlGraphicsListViewAttached(QObject *parent)
+ : QObject(parent), m_view(0), m_isCurrent(false), m_delayRemove(false) {}
+ ~QmlGraphicsListViewAttached() {}
+
+ Q_PROPERTY(QmlGraphicsListView *view READ view CONSTANT)
+ QmlGraphicsListView *view() { return m_view; }
+
+ Q_PROPERTY(bool isCurrentItem READ isCurrentItem NOTIFY currentItemChanged)
+ bool isCurrentItem() const { return m_isCurrent; }
+ void setIsCurrentItem(bool c) {
+ if (m_isCurrent != c) {
+ m_isCurrent = c;
+ emit currentItemChanged();
+ }
+ }
+
+ Q_PROPERTY(QString prevSection READ prevSection NOTIFY prevSectionChanged)
+ QString prevSection() const { return m_prevSection; }
+ void setPrevSection(const QString &sect) {
+ if (m_prevSection != sect) {
+ m_prevSection = sect;
+ emit prevSectionChanged();
+ }
+ }
+
+ Q_PROPERTY(QString section READ section NOTIFY sectionChanged)
+ QString section() const { return m_section; }
+ void setSection(const QString &sect) {
+ if (m_section != sect) {
+ m_section = sect;
+ emit sectionChanged();
+ }
+ }
+
+ Q_PROPERTY(bool delayRemove READ delayRemove WRITE setDelayRemove NOTIFY delayRemoveChanged)
+ bool delayRemove() const { return m_delayRemove; }
+ void setDelayRemove(bool delay) {
+ if (m_delayRemove != delay) {
+ m_delayRemove = delay;
+ emit delayRemoveChanged();
+ }
+ }
+
+ void emitAdd() { emit add(); }
+ void emitRemove() { emit remove(); }
+
+Q_SIGNALS:
+ void currentItemChanged();
+ void sectionChanged();
+ void prevSectionChanged();
+ void delayRemoveChanged();
+ void add();
+ void remove();
+
+public:
+ QmlGraphicsListView *m_view;
+ bool m_isCurrent;
+ mutable QString m_section;
+ QString m_prevSection;
+ bool m_delayRemove;
+};
+
+
QT_END_NAMESPACE
QML_DECLARE_TYPEINFO(QmlGraphicsListView, QML_HAS_ATTACHED_PROPERTIES)
diff --git a/src/declarative/graphicsitems/qmlgraphicsloader.cpp b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
index b3486ef..d778c83 100644
--- a/src/declarative/graphicsitems/qmlgraphicsloader.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsloader.cpp
@@ -108,8 +108,6 @@ void QmlGraphicsLoaderPrivate::initResize()
_q_updateSize();
}
-QML_DEFINE_TYPE(Qt,4,6,Loader,QmlGraphicsLoader)
-
/*!
\qmlclass Loader QmlGraphicsLoader
\inherits Item
diff --git a/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp b/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp
index bd21e7a..fe72e84 100644
--- a/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsmouseregion.cpp
@@ -49,7 +49,6 @@
QT_BEGIN_NAMESPACE
static const int PressAndHoldDelay = 800;
-QML_DEFINE_TYPE(Qt,4,6,Drag,QmlGraphicsDrag)
QmlGraphicsDrag::QmlGraphicsDrag(QObject *parent)
: QObject(parent), _target(0), _axis(XandYAxis), _xmin(0), _xmax(0), _ymin(0), _ymax(0)
{
@@ -231,8 +230,6 @@ QmlGraphicsMouseRegionPrivate::~QmlGraphicsMouseRegionPrivate()
The \e accepted property of the MouseEvent parameter is ignored in this handler.
*/
-QML_DEFINE_TYPE(Qt,4,6,MouseRegion,QmlGraphicsMouseRegion)
-
/*!
\internal
\class QmlGraphicsMouseRegion
diff --git a/src/declarative/graphicsitems/qmlgraphicsparticles.cpp b/src/declarative/graphicsitems/qmlgraphicsparticles.cpp
index 8c5fb4f..5edd59e 100644
--- a/src/declarative/graphicsitems/qmlgraphicsparticles.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsparticles.cpp
@@ -108,8 +108,6 @@ public:
//---------------------------------------------------------------------------
-QML_DEFINE_TYPE(Qt,4,6,ParticleMotion,QmlGraphicsParticleMotion)
-
/*!
\class QmlGraphicsParticleMotion
\ingroup group_effects
@@ -169,8 +167,6 @@ void QmlGraphicsParticleMotion::destroy(QmlGraphicsParticle &particle)
\brief The QmlGraphicsParticleMotionLinear class moves the particles linearly.
*/
-QML_DEFINE_TYPE(Qt,4,6,ParticleMotionLinear,QmlGraphicsParticleMotionLinear)
-
void QmlGraphicsParticleMotionLinear::advance(QmlGraphicsParticle &p, int interval)
{
p.x += interval * p.x_velocity;
@@ -191,8 +187,6 @@ void QmlGraphicsParticleMotionLinear::advance(QmlGraphicsParticle &p, int interv
\brief The QmlGraphicsParticleMotionGravity class moves the particles towards a point.
*/
-QML_DEFINE_TYPE(Qt,4,6,ParticleMotionGravity,QmlGraphicsParticleMotionGravity)
-
/*!
\qmlproperty int ParticleMotionGravity::xattractor
\qmlproperty int ParticleMotionGravity::yattractor
@@ -293,8 +287,6 @@ Rectangle {
This property holds how quickly the paricles will move from side to side.
*/
-QML_DEFINE_TYPE(Qt,4,6,ParticleMotionWander,QmlGraphicsParticleMotionWander)
-
void QmlGraphicsParticleMotionWander::advance(QmlGraphicsParticle &p, int interval)
{
if (!particles)
@@ -561,8 +553,6 @@ void QmlGraphicsParticlesPrivate::updateOpacity(QmlGraphicsParticle &p, int age)
}
}
-QML_DEFINE_TYPE(Qt,4,6,Particles,QmlGraphicsParticles)
-
/*!
\qmlclass Particles
\brief The Particles object generates and moves particles.
diff --git a/src/declarative/graphicsitems/qmlgraphicspath.cpp b/src/declarative/graphicsitems/qmlgraphicspath.cpp
index 18f27af..fae8161 100644
--- a/src/declarative/graphicsitems/qmlgraphicspath.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicspath.cpp
@@ -49,14 +49,6 @@
#include <private/qbezier_p.h>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,Path,QmlGraphicsPath)
-QML_DEFINE_NOCREATE_TYPE(QmlGraphicsPathElement)
-QML_DEFINE_NOCREATE_TYPE(QmlGraphicsCurve)
-QML_DEFINE_TYPE(Qt,4,6,PathAttribute,QmlGraphicsPathAttribute)
-QML_DEFINE_TYPE(Qt,4,6,PathPercent,QmlGraphicsPathPercent)
-QML_DEFINE_TYPE(Qt,4,6,PathLine,QmlGraphicsPathLine)
-QML_DEFINE_TYPE(Qt,4,6,PathQuad,QmlGraphicsPathQuad)
-QML_DEFINE_TYPE(Qt,4,6,PathCubic,QmlGraphicsPathCubic)
/*!
\qmlclass PathElement QmlGraphicsPathElement
diff --git a/src/declarative/graphicsitems/qmlgraphicspathview.cpp b/src/declarative/graphicsitems/qmlgraphicspathview.cpp
index 6718d25..a1c9229 100644
--- a/src/declarative/graphicsitems/qmlgraphicspathview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicspathview.cpp
@@ -54,9 +54,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,PathView,QmlGraphicsPathView)
-
-
inline qreal qmlMod(qreal x, qreal y)
{
#ifdef QT_USE_MATH_H_FLOATS
diff --git a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp
index 5b081a2..142cdce 100644
--- a/src/declarative/graphicsitems/qmlgraphicspositioners.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicspositioners.cpp
@@ -288,7 +288,6 @@ void QmlGraphicsBasePositioner::finishApplyTransitions()
d->moveActions.clear();
}
-QML_DEFINE_TYPE(Qt,4,6,Column,QmlGraphicsColumn)
/*!
\qmlclass Column QmlGraphicsColumn
\brief The Column item lines up its children vertically.
@@ -418,7 +417,6 @@ void QmlGraphicsColumn::doPositioning()
}
}
-QML_DEFINE_TYPE(Qt,4,6,Row,QmlGraphicsRow)
/*!
\qmlclass Row QmlGraphicsRow
\brief The Row item lines up its children horizontally.
@@ -523,7 +521,6 @@ void QmlGraphicsRow::doPositioning()
}
}
-QML_DEFINE_TYPE(Qt,4,6,Grid,QmlGraphicsGrid)
/*!
\qmlclass Grid QmlGraphicsGrid
@@ -711,7 +708,6 @@ void QmlGraphicsGrid::doPositioning()
}
-QML_DEFINE_TYPE(Qt,4,6,Flow,QmlGraphicsFlow)
/*!
\qmlclass Flow QmlGraphicsFlow
\brief The Flow item lines up its children side by side, wrapping as necessary.
diff --git a/src/declarative/graphicsitems/qmlgraphicsrectangle.cpp b/src/declarative/graphicsitems/qmlgraphicsrectangle.cpp
index cc09436..ec44d93 100644
--- a/src/declarative/graphicsitems/qmlgraphicsrectangle.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsrectangle.cpp
@@ -46,9 +46,6 @@
#include <QtCore/qmath.h>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,Pen,QmlGraphicsPen)
-QML_DEFINE_TYPE(Qt,4,6,GradientStop,QmlGraphicsGradientStop)
-QML_DEFINE_TYPE(Qt,4,6,Gradient,QmlGraphicsGradient)
/*!
\internal
@@ -149,7 +146,6 @@ void QmlGraphicsGradient::doUpdate()
emit updated();
}
-QML_DEFINE_TYPE(Qt,4,6,Rectangle,QmlGraphicsRectangle)
/*!
\qmlclass Rectangle QmlGraphicsRectangle
diff --git a/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp b/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
index 99f0faa..f0e5bb3 100644
--- a/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsrepeater.cpp
@@ -60,8 +60,6 @@ QmlGraphicsRepeaterPrivate::~QmlGraphicsRepeaterPrivate()
delete model;
}
-QML_DEFINE_TYPE(Qt,4,6,Repeater,QmlGraphicsRepeater)
-
/*!
\qmlclass Repeater QmlGraphicsRepeater
\inherits Item
diff --git a/src/declarative/graphicsitems/qmlgraphicsscalegrid.cpp b/src/declarative/graphicsitems/qmlgraphicsscalegrid.cpp
index f50b79b..94b562b 100644
--- a/src/declarative/graphicsitems/qmlgraphicsscalegrid.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsscalegrid.cpp
@@ -52,7 +52,6 @@ QT_BEGIN_NAMESPACE
\class QmlGraphicsScaleGrid
\brief The QmlGraphicsScaleGrid class allows you to specify a 3x3 grid to use in scaling an image.
*/
-QML_DEFINE_NOCREATE_TYPE(QmlGraphicsScaleGrid)
QmlGraphicsScaleGrid::QmlGraphicsScaleGrid(QObject *parent) : QObject(parent), _left(0), _top(0), _right(0), _bottom(0)
{
diff --git a/src/declarative/graphicsitems/qmlgraphicstext.cpp b/src/declarative/graphicsitems/qmlgraphicstext.cpp
index b13fb7c..89081eb 100644
--- a/src/declarative/graphicsitems/qmlgraphicstext.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstext.cpp
@@ -55,7 +55,6 @@
#include <qmath.h>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,Text,QmlGraphicsText)
/*!
\qmlclass Text QmlGraphicsText
diff --git a/src/declarative/graphicsitems/qmlgraphicstextedit.cpp b/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
index fc80258..00f7e42 100644
--- a/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstextedit.cpp
@@ -56,7 +56,6 @@
#include <private/qtextcontrol_p.h>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,TextEdit,QmlGraphicsTextEdit)
/*!
\qmlclass TextEdit QmlGraphicsTextEdit
diff --git a/src/declarative/graphicsitems/qmlgraphicstextinput.cpp b/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
index 6d79c7a..ea54351 100644
--- a/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicstextinput.cpp
@@ -51,12 +51,6 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,TextInput,QmlGraphicsTextInput);
-QML_DEFINE_NOCREATE_TYPE(QValidator);
-QML_DEFINE_TYPE(Qt,4,6,QIntValidator,QIntValidator);
-QML_DEFINE_TYPE(Qt,4,6,QDoubleValidator,QDoubleValidator);
-QML_DEFINE_TYPE(Qt,4,6,QRegExpValidator,QRegExpValidator);
-
/*!
\qmlclass TextInput QmlGraphicsTextInput
The TextInput item allows you to add an editable line of text to a scene.
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
index 2fc143d..b4487a6 100644
--- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel.cpp
@@ -66,44 +66,6 @@ QML_DECLARE_TYPE(QListModelInterface)
QT_BEGIN_NAMESPACE
-class QmlGraphicsVisualItemModelAttached : public QObject
-{
- Q_OBJECT
-
-public:
- QmlGraphicsVisualItemModelAttached(QObject *parent)
- : QObject(parent), m_index(0) {}
- ~QmlGraphicsVisualItemModelAttached() {
- attachedProperties.remove(parent());
- }
-
- Q_PROPERTY(int index READ index NOTIFY indexChanged)
- int index() const { return m_index; }
- void setIndex(int idx) {
- if (m_index != idx) {
- m_index = idx;
- emit indexChanged();
- }
- }
-
- static QmlGraphicsVisualItemModelAttached *properties(QObject *obj) {
- QmlGraphicsVisualItemModelAttached *rv = attachedProperties.value(obj);
- if (!rv) {
- rv = new QmlGraphicsVisualItemModelAttached(obj);
- attachedProperties.insert(obj, rv);
- }
- return rv;
- }
-
-Q_SIGNALS:
- void indexChanged();
-
-public:
- int m_index;
-
- static QHash<QObject*, QmlGraphicsVisualItemModelAttached*> attachedProperties;
-};
-
QHash<QObject*, QmlGraphicsVisualItemModelAttached*> QmlGraphicsVisualItemModelAttached::attachedProperties;
@@ -1146,10 +1108,6 @@ void QmlGraphicsVisualDataModel::_q_destroyingPackage(QmlPackage *package)
emit destroyingItem(qobject_cast<QmlGraphicsItem*>(package->part(d->m_part)));
}
-QML_DEFINE_NOCREATE_TYPE(QmlGraphicsVisualModel);
-QML_DEFINE_TYPE(Qt,4,6,VisualItemModel,QmlGraphicsVisualItemModel)
-QML_DEFINE_TYPE(Qt,4,6,VisualDataModel,QmlGraphicsVisualDataModel)
-
QT_END_NAMESPACE
#include <qmlgraphicsvisualitemmodel.moc>
diff --git a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel_p.h b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel_p.h
index ef849b0..9ebf626 100644
--- a/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicsvisualitemmodel_p.h
@@ -195,6 +195,45 @@ private:
Q_DISABLE_COPY(QmlGraphicsVisualDataModel)
};
+class QmlGraphicsVisualItemModelAttached : public QObject
+{
+ Q_OBJECT
+
+public:
+ QmlGraphicsVisualItemModelAttached(QObject *parent)
+ : QObject(parent), m_index(0) {}
+ ~QmlGraphicsVisualItemModelAttached() {
+ attachedProperties.remove(parent());
+ }
+
+ Q_PROPERTY(int index READ index NOTIFY indexChanged)
+ int index() const { return m_index; }
+ void setIndex(int idx) {
+ if (m_index != idx) {
+ m_index = idx;
+ emit indexChanged();
+ }
+ }
+
+ static QmlGraphicsVisualItemModelAttached *properties(QObject *obj) {
+ QmlGraphicsVisualItemModelAttached *rv = attachedProperties.value(obj);
+ if (!rv) {
+ rv = new QmlGraphicsVisualItemModelAttached(obj);
+ attachedProperties.insert(obj, rv);
+ }
+ return rv;
+ }
+
+Q_SIGNALS:
+ void indexChanged();
+
+public:
+ int m_index;
+
+ static QHash<QObject*, QmlGraphicsVisualItemModelAttached*> attachedProperties;
+};
+
+
QT_END_NAMESPACE
QML_DECLARE_TYPE(QmlGraphicsVisualModel)
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview.cpp b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
index 85fd0d7..c71a366 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview.cpp
+++ b/src/declarative/graphicsitems/qmlgraphicswebview.cpp
@@ -64,13 +64,9 @@
#include <qlistmodelinterface_p.h>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4,6,WebView,QmlGraphicsWebView)
-QML_DEFINE_NOCREATE_TYPE(QAction)
static const int MAX_DOUBLECLICK_TIME=500; // XXX need better gesture system
-QML_DEFINE_NOCREATE_TYPE(QmlGraphicsWebSettings)
-
class QmlGraphicsWebViewPrivate : public QmlGraphicsPaintedItemPrivate
{
Q_DECLARE_PUBLIC(QmlGraphicsWebView)
@@ -461,30 +457,6 @@ QmlList<QObject *> *QmlGraphicsWebView::javaScriptWindowObjects()
return &d->windowObjects;
}
-class QmlGraphicsWebViewAttached : public QObject
-{
- Q_OBJECT
- Q_PROPERTY(QString windowObjectName READ windowObjectName WRITE setWindowObjectName)
-public:
- QmlGraphicsWebViewAttached(QObject *parent)
- : QObject(parent)
- {
- }
-
- QString windowObjectName() const
- {
- return m_windowObjectName;
- }
-
- void setWindowObjectName(const QString &n)
- {
- m_windowObjectName = n;
- }
-
-private:
- QString m_windowObjectName;
-};
-
QmlGraphicsWebViewAttached *QmlGraphicsWebView::qmlAttachedProperties(QObject *o)
{
return new QmlGraphicsWebViewAttached(o);
diff --git a/src/declarative/graphicsitems/qmlgraphicswebview_p.h b/src/declarative/graphicsitems/qmlgraphicswebview_p.h
index f5edb7a..0aaf895 100644
--- a/src/declarative/graphicsitems/qmlgraphicswebview_p.h
+++ b/src/declarative/graphicsitems/qmlgraphicswebview_p.h
@@ -246,11 +246,35 @@ private:
friend class QmlGraphicsWebPage;
};
+class QmlGraphicsWebViewAttached : public QObject
+{
+ Q_OBJECT
+ Q_PROPERTY(QString windowObjectName READ windowObjectName WRITE setWindowObjectName)
+public:
+ QmlGraphicsWebViewAttached(QObject *parent)
+ : QObject(parent)
+ {
+ }
+
+ QString windowObjectName() const
+ {
+ return m_windowObjectName;
+ }
+
+ void setWindowObjectName(const QString &n)
+ {
+ m_windowObjectName = n;
+ }
+
+private:
+ QString m_windowObjectName;
+};
+
+
QT_END_NAMESPACE
QML_DECLARE_TYPE(QmlGraphicsWebView)
QML_DECLARE_TYPEINFO(QmlGraphicsWebView, QML_HAS_ATTACHED_PROPERTIES)
-QML_DECLARE_TYPE(QAction)
QT_END_HEADER
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp
index 9e06016..343bd4b 100644
--- a/src/declarative/qml/qmlcomponent.cpp
+++ b/src/declarative/qml/qmlcomponent.cpp
@@ -539,7 +539,6 @@ QObject *QmlComponent::create(QmlContext *context)
QObject *QmlComponentPrivate::create(QmlContext *context,
const QBitField &bindings)
{
- QObject *create(QmlContext *context, const QBitField &);
if (!context)
context = engine->rootContext();
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index cdbe5f3..35fc3d4 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -95,6 +95,8 @@
#include <private/qobject_p.h>
#include <private/qscriptdeclarativeclass_p.h>
+#include <private/qmlgraphicsitemsmodule_p.h>
+
#ifdef Q_OS_WIN // for %APPDATA%
#include <qt_windows.h>
#include <qlibrary.h>
@@ -136,6 +138,8 @@ struct StaticQtMetaObject : public QObject
{ return &static_cast<StaticQtMetaObject*> (0)->staticQtMetaObject; }
};
+static bool qt_QmlQtModule_registered = false;
+
QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e)
: captureProperties(false), rootContext(0), currentExpression(0), isDebugging(false),
contextClass(0), sharedContext(0), sharedScope(0), objectClass(0), valueTypeClass(0),
@@ -144,6 +148,10 @@ QmlEnginePrivate::QmlEnginePrivate(QmlEngine *e)
networkAccessManager(0), networkAccessManagerFactory(0),
typeManager(e), uniqueId(1)
{
+ if (!qt_QmlQtModule_registered) {
+ qt_QmlQtModule_registered = true;
+ QmlGraphicsItemModule::defineModule();
+ }
globalClass = new QmlGlobalScriptClass(&scriptEngine);
fileImportPath.append(QLibraryInfo::location(QLibraryInfo::DataPath)+QDir::separator()+QLatin1String("qml"));
}