diff options
124 files changed, 766 insertions, 292 deletions
diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp index de75bde..d4891ff 100644 --- a/src/corelib/kernel/qmetaobjectbuilder.cpp +++ b/src/corelib/kernel/qmetaobjectbuilder.cpp @@ -1,16 +1,49 @@ /**************************************************************************** ** -** This file is part of the $PACKAGE_NAME$. +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** Copyright (C) $THISYEAR$ $COMPANY_NAME$. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $QT_EXTENDED_DUAL_LICENSE$ +** $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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ ** ****************************************************************************/ #include "qmetaobjectbuilder_p.h" #include <QDebug> +QT_BEGIN_NAMESPACE + /*! \class QMetaObjectBuilder \brief The QMetaObjectBuilder class supports building QMetaObject objects at runtime. @@ -2444,3 +2477,5 @@ void QMetaEnumBuilder::removeKey(int index) d->values.removeAt(index); } } + +QT_END_NAMESPACE diff --git a/src/corelib/kernel/qmetaobjectbuilder_p.h b/src/corelib/kernel/qmetaobjectbuilder_p.h index dc95745..952364a 100644 --- a/src/corelib/kernel/qmetaobjectbuilder_p.h +++ b/src/corelib/kernel/qmetaobjectbuilder_p.h @@ -1,21 +1,65 @@ /**************************************************************************** ** -** This file is part of the $PACKAGE_NAME$. +** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). +** Contact: Nokia Corporation (qt-info@nokia.com) ** -** Copyright (C) $THISYEAR$ $COMPANY_NAME$. +** This file is part of the QtCore module of the Qt Toolkit. ** -** $QT_EXTENDED_DUAL_LICENSE$ +** $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 either Technology Preview License Agreement or the +** Beta Release License Agreement. +** +** 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.0, 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. +** +** If you are unsure which license is appropriate for your use, please +** contact the sales department at http://www.qtsoftware.com/contact. +** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QMETAOBJECTBUILDER_H #define QMETAOBJECTBUILDER_H +// +// W A R N I N G +// ------------- +// +// This file is not part of the Qt API. It exists for the convenience +// of moc. This header file may change from version to version without notice, +// or even be removed. +// +// We mean it. +// + #include <QtCore/qobject.h> #include <QtCore/qmetaobject.h> #include <QtCore/qdatastream.h> #include <QtCore/qmap.h> +QT_BEGIN_NAMESPACE + class QMetaObjectBuilderPrivate; class QMetaMethodBuilder; class QMetaMethodBuilderPrivate; @@ -266,4 +310,6 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::AddMembers) Q_DECLARE_OPERATORS_FOR_FLAGS(QMetaObjectBuilder::MetaObjectFlags) +QT_END_NAMESPACE + #endif diff --git a/src/declarative/canvas/qsimplecanvas_p.h b/src/declarative/canvas/qsimplecanvas_p.h index 3a0186e..c900ccf 100644 --- a/src/declarative/canvas/qsimplecanvas_p.h +++ b/src/declarative/canvas/qsimplecanvas_p.h @@ -81,11 +81,14 @@ private: QSimpleCanvas::Matrix defaultTransform; QSimpleCanvas::Matrix invDefaultTransform; }; +QT_END_NAMESPACE #endif #include <QGraphicsView> #include <QGraphicsScene> +QT_BEGIN_NAMESPACE + struct QSimpleCanvasGraphicsView : public QGraphicsView { public: @@ -198,6 +201,6 @@ public: int paintVersion; }; -#endif - QT_END_NAMESPACE + +#endif diff --git a/src/declarative/canvas/qsimplecanvasitem.h b/src/declarative/canvas/qsimplecanvasitem.h index dce3007..6452aa4 100644 --- a/src/declarative/canvas/qsimplecanvasitem.h +++ b/src/declarative/canvas/qsimplecanvasitem.h @@ -328,11 +328,8 @@ private: QSimpleCanvasLayer(); }; - - -#endif // _GFXCANVASITEM_H_ - - QT_END_NAMESPACE QT_END_HEADER + +#endif // QSIMPLECANVASITEM_H diff --git a/src/declarative/declarative.pro b/src/declarative/declarative.pro index 382f3cb..9f555fe 100644 --- a/src/declarative/declarative.pro +++ b/src/declarative/declarative.pro @@ -3,7 +3,6 @@ QPRO_PWD = $$PWD QT = core gui xml script network contains(QT_CONFIG, svg): QT += svg DEFINES += QT_BUILD_DECLARATIVE_LIB -DEFINES += QT_NO_USING_NAMESPACE win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x66000000 solaris-cc*:QMAKE_CXXFLAGS_RELEASE -= -O2 diff --git a/src/declarative/extra/extra.pri b/src/declarative/extra/extra.pri index fde4e3a..fca8ec8 100644 --- a/src/declarative/extra/extra.pri +++ b/src/declarative/extra/extra.pri @@ -8,6 +8,7 @@ SOURCES += \ extra/qfxanimatedimageitem.cpp \ extra/qfxblendedimage.cpp \ extra/qfxflowview.cpp \ + extra/qfxparticles.cpp \ extra/qmlbehaviour.cpp \ extra/qbindablemap.cpp @@ -22,6 +23,7 @@ HEADERS += \ extra/qfxanimatedimageitem_p.h \ extra/qfxblendedimage.h \ extra/qfxflowview.h \ + extra/qfxparticles.h \ extra/qmlbehaviour.h \ extra/qbindablemap.h diff --git a/src/declarative/extra/qbindablemap.h b/src/declarative/extra/qbindablemap.h index c76928d..aa1908e 100644 --- a/src/declarative/extra/qbindablemap.h +++ b/src/declarative/extra/qbindablemap.h @@ -48,7 +48,6 @@ #include <QtCore/QStringList> #include <QtCore/QVariant> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE @@ -80,8 +79,8 @@ private: friend class QBindableMapMetaObject; }; - QT_END_NAMESPACE QT_END_HEADER + #endif diff --git a/src/declarative/extra/qfxanimatedimageitem.h b/src/declarative/extra/qfxanimatedimageitem.h index 5d115d7..86ded86 100644 --- a/src/declarative/extra/qfxanimatedimageitem.h +++ b/src/declarative/extra/qfxanimatedimageitem.h @@ -44,12 +44,12 @@ #include <QtDeclarative/qfximage.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QMovie; class QFxAnimatedImageItemPrivate; @@ -91,10 +91,10 @@ private: Q_DECLARE_PRIVATE(QFxAnimatedImageItem) }; -QML_DECLARE_TYPE(QFxAnimatedImageItem) - - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxAnimatedImageItem) + QT_END_HEADER + #endif diff --git a/src/declarative/extra/qfxblendedimage.h b/src/declarative/extra/qfxblendedimage.h index 248cc9d..44de94c 100644 --- a/src/declarative/extra/qfxblendedimage.h +++ b/src/declarative/extra/qfxblendedimage.h @@ -101,10 +101,11 @@ private: QPixmap primPix; QPixmap secPix; }; -QML_DECLARE_TYPE(QFxBlendedImage) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxBlendedImage) + QT_END_HEADER + #endif // QFXBLENDEDIMAGE_H diff --git a/src/declarative/extra/qfxflowview.cpp b/src/declarative/extra/qfxflowview.cpp index 77cd6df..254e423 100644 --- a/src/declarative/extra/qfxflowview.cpp +++ b/src/declarative/extra/qfxflowview.cpp @@ -42,6 +42,8 @@ #include "qfxvisualitemmodel.h" #include "qfxflowview.h" +#include <QGraphicsSceneMouseEvent> + QT_BEGIN_NAMESPACE class QFxFlowViewAttached : public QObject @@ -288,8 +290,6 @@ void QFxFlowView::moveItem(QFxItem *item, const QPointF &p) m_timeline.move(*yv, p.y(), 100); } -#include <QGraphicsSceneMouseEvent> - void QFxFlowView::mousePressEvent(QGraphicsSceneMouseEvent *event) { for (int ii = 0; ii < m_items.count(); ++ii) { @@ -376,6 +376,6 @@ void QFxFlowView::mouseMoveEvent(QGraphicsSceneMouseEvent *event) QML_DEFINE_TYPE(QFxFlowView,FlowView); -#include "qfxflowview.moc" - QT_END_NAMESPACE + +#include "qfxflowview.moc" diff --git a/src/declarative/extra/qfxflowview.h b/src/declarative/extra/qfxflowview.h index 0e7c2d3..2bec6a1 100644 --- a/src/declarative/extra/qfxflowview.h +++ b/src/declarative/extra/qfxflowview.h @@ -50,6 +50,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxVisualItemModel; class QFxFlowViewValue; class QFxFlowViewAttached; @@ -97,10 +98,11 @@ private: QList<QFxFlowViewValue *> m_values; int m_dragIdx; }; -QML_DECLARE_TYPE(QFxFlowView); QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxFlowView); + QT_END_HEADER #endif // QFXFLOWVIEW_H diff --git a/src/declarative/extra/qfxintegermodel.cpp b/src/declarative/extra/qfxintegermodel.cpp index 53814cd..437073e 100644 --- a/src/declarative/extra/qfxintegermodel.cpp +++ b/src/declarative/extra/qfxintegermodel.cpp @@ -41,8 +41,8 @@ #include "qfxintegermodel.h" - QT_BEGIN_NAMESPACE + QML_DEFINE_TYPE(QFxIntegerModel, IntegerModel) class QFxIntegerModelPrivate diff --git a/src/declarative/extra/qfxintegermodel.h b/src/declarative/extra/qfxintegermodel.h index 43504d8..7fced2c 100644 --- a/src/declarative/extra/qfxintegermodel.h +++ b/src/declarative/extra/qfxintegermodel.h @@ -46,12 +46,12 @@ #include <QtDeclarative/qml.h> #include <QtDeclarative/qlistmodelinterface.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxIntegerModelPrivate; class Q_DECLARATIVE_EXPORT QFxIntegerModel : public QListModelInterface { @@ -77,10 +77,10 @@ private: QFxIntegerModelPrivate *d; }; -QML_DECLARE_TYPE(QFxIntegerModel) - - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxIntegerModel) + QT_END_HEADER + #endif diff --git a/src/declarative/fx/qfxparticles.cpp b/src/declarative/extra/qfxparticles.cpp index 4cd34c4..62fe4c1 100644 --- a/src/declarative/fx/qfxparticles.cpp +++ b/src/declarative/extra/qfxparticles.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qfxitem_p.h" +#include "private/qfxitem_p.h" #if defined(QFX_RENDER_OPENGL) #include "gltexture.h" #endif diff --git a/src/declarative/fx/qfxparticles.h b/src/declarative/extra/qfxparticles.h index b3a569b..cfaffa7 100644 --- a/src/declarative/fx/qfxparticles.h +++ b/src/declarative/extra/qfxparticles.h @@ -66,7 +66,6 @@ public: virtual void created(QFxParticle &); virtual void destroy(QFxParticle &); }; -QML_DECLARE_TYPE(QFxParticleMotion) class Q_DECLARATIVE_EXPORT QFxParticleMotionLinear : public QFxParticleMotion { @@ -77,7 +76,6 @@ public: virtual void advance(QFxParticle &, int interval); }; -QML_DECLARE_TYPE(QFxParticleMotionLinear) class Q_DECLARATIVE_EXPORT QFxParticleMotionGravity : public QFxParticleMotion { @@ -106,7 +104,6 @@ private: int _yAttr; qreal _accel; }; -QML_DECLARE_TYPE(QFxParticleMotionGravity) class Q_DECLARATIVE_EXPORT QFxParticleMotionWander : public QFxParticleMotion { @@ -146,7 +143,6 @@ private: qreal _yvariance; qreal _pace; }; -QML_DECLARE_TYPE(QFxParticleMotionWander) class QFxParticlesPrivate; class Q_DECLARATIVE_EXPORT QFxParticles : public QFxItem @@ -231,10 +227,15 @@ private: Q_DISABLE_COPY(QFxParticles) Q_DECLARE_PRIVATE(QFxParticles) }; -QML_DECLARE_TYPE(QFxParticles) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxParticleMotion) +QML_DECLARE_TYPE(QFxParticleMotionLinear) +QML_DECLARE_TYPE(QFxParticleMotionGravity) +QML_DECLARE_TYPE(QFxParticleMotionWander) +QML_DECLARE_TYPE(QFxParticles) + QT_END_HEADER #endif diff --git a/src/declarative/extra/qmlbehaviour.cpp b/src/declarative/extra/qmlbehaviour.cpp index 4beca5e..4165d56 100644 --- a/src/declarative/extra/qmlbehaviour.cpp +++ b/src/declarative/extra/qmlbehaviour.cpp @@ -254,6 +254,6 @@ void QmlBehaviour::classComplete() d->context->deactivate(); } -#include "qmlbehaviour.moc" - QT_END_NAMESPACE + +#include "qmlbehaviour.moc" diff --git a/src/declarative/extra/qmlbehaviour.h b/src/declarative/extra/qmlbehaviour.h index 7cc83b2..1b5f524 100644 --- a/src/declarative/extra/qmlbehaviour.h +++ b/src/declarative/extra/qmlbehaviour.h @@ -51,6 +51,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QmlAbstractAnimation; class QmlBehaviourPrivate; class Q_DECLARATIVE_EXPORT QmlBehaviour : public QmlPropertyValueSource, @@ -86,10 +87,11 @@ protected: private Q_SLOTS: void propertyValueChanged(); }; -QML_DECLARE_TYPE(QmlBehaviour) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlBehaviour) + QT_END_HEADER #endif // QMLBEHAVIOUR_H diff --git a/src/declarative/extra/qmldatetimeformatter.cpp b/src/declarative/extra/qmldatetimeformatter.cpp index ad0e473..158431a 100644 --- a/src/declarative/extra/qmldatetimeformatter.cpp +++ b/src/declarative/extra/qmldatetimeformatter.cpp @@ -44,6 +44,7 @@ #include <QtCore/qlocale.h> QT_BEGIN_NAMESPACE + //TODO: may need optimisation as the QDateTime member may not be needed? // be able to set a locale? @@ -365,4 +366,5 @@ void QmlDateTimeFormatter::classComplete() } QML_DEFINE_TYPE(QmlDateTimeFormatter, DateTimeFormatter) + QT_END_NAMESPACE diff --git a/src/declarative/extra/qmldatetimeformatter.h b/src/declarative/extra/qmldatetimeformatter.h index 84b27e3..71b366c 100644 --- a/src/declarative/extra/qmldatetimeformatter.h +++ b/src/declarative/extra/qmldatetimeformatter.h @@ -50,6 +50,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QmlDateTimeFormatterPrivate; class Q_DECLARATIVE_EXPORT QmlDateTimeFormatter : public QObject, public QmlParserStatus { @@ -106,10 +107,10 @@ private: Q_DECLARE_PRIVATE(QmlDateTimeFormatter) }; -QML_DECLARE_TYPE(QmlDateTimeFormatter) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlDateTimeFormatter) + QT_END_HEADER #endif diff --git a/src/declarative/extra/qmlfolderlistmodel.cpp b/src/declarative/extra/qmlfolderlistmodel.cpp index 649169b..8b008a5 100644 --- a/src/declarative/extra/qmlfolderlistmodel.cpp +++ b/src/declarative/extra/qmlfolderlistmodel.cpp @@ -46,8 +46,6 @@ QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) - class QmlFolderListModelPrivate : public QObjectPrivate { public: diff --git a/src/declarative/extra/qmlfolderlistmodel.h b/src/declarative/extra/qmlfolderlistmodel.h index d46ec79..8c99b22 100644 --- a/src/declarative/extra/qmlfolderlistmodel.h +++ b/src/declarative/extra/qmlfolderlistmodel.h @@ -96,10 +96,10 @@ private: Q_DISABLE_COPY(QmlFolderListModel) }; -QML_DECLARE_TYPE(QmlFolderListModel) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlFolderListModel) + QT_END_HEADER #endif // QMLFOLDERLISTMODEL_H diff --git a/src/declarative/extra/qmlnumberformatter.cpp b/src/declarative/extra/qmlnumberformatter.cpp index 1549525..b24f2d8 100644 --- a/src/declarative/extra/qmlnumberformatter.cpp +++ b/src/declarative/extra/qmlnumberformatter.cpp @@ -42,8 +42,8 @@ #include "qmlnumberformatter.h" #include "private/qobject_p.h" - QT_BEGIN_NAMESPACE + //TODO: set locale // docs // this is a wrapper around qnumberformat (test integration) @@ -210,6 +210,6 @@ void QmlNumberFormatter::classComplete() d->classComplete = true; d->updateText(); } - QML_DEFINE_TYPE(QmlNumberFormatter, NumberFormatter); + QT_END_NAMESPACE diff --git a/src/declarative/extra/qmlnumberformatter.h b/src/declarative/extra/qmlnumberformatter.h index e4efc03..6924fa5 100644 --- a/src/declarative/extra/qmlnumberformatter.h +++ b/src/declarative/extra/qmlnumberformatter.h @@ -45,12 +45,12 @@ #include <QtDeclarative/qml.h> #include <QtDeclarative/qnumberformat.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QmlNumberFormatterPrivate; class Q_DECLARATIVE_EXPORT QmlNumberFormatter : public QObject, public QmlParserStatus { @@ -83,10 +83,10 @@ private: Q_DECLARE_PRIVATE(QmlNumberFormatter) }; -QML_DECLARE_TYPE(QmlNumberFormatter) - - QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlNumberFormatter) + QT_END_HEADER + #endif diff --git a/src/declarative/extra/qmlsqlconnection.h b/src/declarative/extra/qmlsqlconnection.h index ede8bcb..88a727a 100644 --- a/src/declarative/extra/qmlsqlconnection.h +++ b/src/declarative/extra/qmlsqlconnection.h @@ -50,6 +50,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QSqlDatabase; class QmlSqlConnectionPrivate; class Q_DECLARATIVE_EXPORT QmlSqlConnection : public QObject, public QmlParserStatus @@ -107,10 +108,11 @@ private: Q_DECLARE_PRIVATE(QmlSqlConnection) }; -QML_DECLARE_TYPE(QmlSqlConnection) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlSqlConnection) + QT_END_HEADER + #endif // QMLXMLLISTMODEL_H diff --git a/src/declarative/extra/qmlsqlquery.cpp b/src/declarative/extra/qmlsqlquery.cpp index 2b11774..d9d9760 100644 --- a/src/declarative/extra/qmlsqlquery.cpp +++ b/src/declarative/extra/qmlsqlquery.cpp @@ -55,6 +55,7 @@ #include <QTimerEvent> QT_BEGIN_NAMESPACE + QML_DEFINE_TYPE(QmlSqlBind, SqlBind) QML_DEFINE_TYPE(QmlSqlQuery, SqlQuery) @@ -790,4 +791,5 @@ void QmlSqlQueryPrivate::grabRoles() const roles.append(i); } } + QT_END_NAMESPACE diff --git a/src/declarative/extra/qmlsqlquery.h b/src/declarative/extra/qmlsqlquery.h index 06ade08..8be758f 100644 --- a/src/declarative/extra/qmlsqlquery.h +++ b/src/declarative/extra/qmlsqlquery.h @@ -82,8 +82,6 @@ private: Q_DECLARE_PRIVATE(QmlSqlBind) }; -QML_DECLARE_TYPE(QmlSqlBind) - class QSqlQuery; class QmlSqlQueryPrivate; class Q_DECLARATIVE_EXPORT QmlSqlQuery : public QListModelInterface, public QmlParserStatus @@ -135,10 +133,12 @@ private: Q_DECLARE_PRIVATE(QmlSqlQuery) }; -QML_DECLARE_TYPE(QmlSqlQuery) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlSqlBind) +QML_DECLARE_TYPE(QmlSqlQuery) + QT_END_HEADER + #endif diff --git a/src/declarative/extra/qmltimer.h b/src/declarative/extra/qmltimer.h index 8171385..0df4cb9 100644 --- a/src/declarative/extra/qmltimer.h +++ b/src/declarative/extra/qmltimer.h @@ -48,6 +48,7 @@ #include <QtDeclarative/qml.h> QT_BEGIN_HEADER + QT_BEGIN_NAMESPACE QT_MODULE(Declarative) @@ -92,8 +93,11 @@ private Q_SLOTS: void ticked(); void stateChanged(QAbstractAnimation::State,QAbstractAnimation::State); }; -QML_DECLARE_TYPE(QmlTimer) QT_END_NAMESPACE + +QML_DECLARE_TYPE(QmlTimer) + QT_END_HEADER + #endif diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp index 082c9c2..48949b3 100644 --- a/src/declarative/extra/qmlxmllistmodel.cpp +++ b/src/declarative/extra/qmlxmllistmodel.cpp @@ -61,7 +61,6 @@ QT_BEGIN_NAMESPACE QML_DEFINE_TYPE(XmlListModelRole, XmlRole) QML_DEFINE_TYPE(QmlXmlListModel, XmlListModel) - class QmlXmlListModelPrivate; struct QmlXmlRoleList : public QmlConcreteList<XmlListModelRole *> { @@ -643,6 +642,6 @@ void QmlXmlListModel::queryCompleted(int id, int size) } } -#include "qmlxmllistmodel.moc" - QT_END_NAMESPACE + +#include "qmlxmllistmodel.moc" diff --git a/src/declarative/extra/qmlxmllistmodel.h b/src/declarative/extra/qmlxmllistmodel.h index 0d41456..804f13f 100644 --- a/src/declarative/extra/qmlxmllistmodel.h +++ b/src/declarative/extra/qmlxmllistmodel.h @@ -84,7 +84,6 @@ private: QString m_name; QString m_query; }; -QML_DECLARE_TYPE(XmlListModelRole) class QmlXmlListModelPrivate; class Q_DECLARATIVE_EXPORT QmlXmlListModel : public QListModelInterface, public QmlParserStatus @@ -144,10 +143,11 @@ private: Q_DISABLE_COPY(QmlXmlListModel) }; -QML_DECLARE_TYPE(QmlXmlListModel) - QT_END_NAMESPACE +QML_DECLARE_TYPE(XmlListModelRole) +QML_DECLARE_TYPE(QmlXmlListModel) + QT_END_HEADER #endif // QMLXMLLISTMODEL_H diff --git a/src/declarative/extra/qnumberformat.cpp b/src/declarative/extra/qnumberformat.cpp index 424c125..cde2fb0 100644 --- a/src/declarative/extra/qnumberformat.cpp +++ b/src/declarative/extra/qnumberformat.cpp @@ -41,9 +41,9 @@ #include "qnumberformat.h" - QT_BEGIN_NAMESPACE -QML_DEFINE_TYPE(QNumberFormat,NumberFormat) + +QML_DEFINE_NOCREATE_TYPE(QNumberFormat) QNumberFormat::QNumberFormat(QObject *parent) : QObject(parent), _number(0), _type(Decimal), _groupingSize(0) @@ -221,4 +221,5 @@ QString QNumberFormat::formatDecimal(const QString &formatDec, const QString &de } return outputDecimal; } + QT_END_NAMESPACE diff --git a/src/declarative/extra/qnumberformat.h b/src/declarative/extra/qnumberformat.h index fba9872..830cf79 100644 --- a/src/declarative/extra/qnumberformat.h +++ b/src/declarative/extra/qnumberformat.h @@ -163,10 +163,11 @@ private: QString _text; }; -QML_DECLARE_TYPE(QNumberFormat) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QNumberFormat) + QT_END_HEADER + #endif diff --git a/src/declarative/fx/fx.pri b/src/declarative/fx/fx.pri index 69fada0..fd6e480 100644 --- a/src/declarative/fx/fx.pri +++ b/src/declarative/fx/fx.pri @@ -26,7 +26,6 @@ HEADERS += \ fx/qfxlayouts_p.h \ fx/qfxmouseregion.h \ fx/qfxmouseregion_p.h \ - fx/qfxparticles.h \ fx/qfxpath.h \ fx/qfxpath_p.h \ fx/qfxpathview.h \ @@ -67,7 +66,6 @@ SOURCES += \ fx/qfxkeyproxy.cpp \ fx/qfxlayouts.cpp \ fx/qfxmouseregion.cpp \ - fx/qfxparticles.cpp \ fx/qfxpath.cpp \ fx/qfxpathview.cpp \ fx/qfxrect.cpp \ diff --git a/src/declarative/fx/qfxanchors.h b/src/declarative/fx/qfxanchors.h index 94c22a6..dcd5d79 100644 --- a/src/declarative/fx/qfxanchors.h +++ b/src/declarative/fx/qfxanchors.h @@ -77,8 +77,6 @@ public: AnchorLine anchorLine; }; -Q_DECLARE_METATYPE(QFxAnchorLine) - class QFxAnchorsPrivate; class Q_DECLARATIVE_EXPORT QFxAnchors : public QObject { @@ -186,10 +184,12 @@ private: Q_DISABLE_COPY(QFxAnchors) Q_DECLARE_PRIVATE(QFxAnchors) }; -QML_DECLARE_TYPE(QFxAnchors) QT_END_NAMESPACE +Q_DECLARE_METATYPE(QFxAnchorLine) +QML_DECLARE_TYPE(QFxAnchors) + QT_END_HEADER #endif diff --git a/src/declarative/fx/qfxblurfilter.h b/src/declarative/fx/qfxblurfilter.h index 90285de..830663f 100644 --- a/src/declarative/fx/qfxblurfilter.h +++ b/src/declarative/fx/qfxblurfilter.h @@ -45,12 +45,12 @@ #include <QtDeclarative/qsimplecanvasfilter.h> #include <QtDeclarative/qml.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxBlurFilterPrivate; class Q_DECLARATIVE_EXPORT QFxBlurFilter : public QSimpleCanvasFilter { @@ -73,10 +73,11 @@ protected: private: QFxBlurFilterPrivate *d; }; -QML_DECLARE_TYPE(QFxBlurFilter) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxBlurFilter) + QT_END_HEADER + #endif // QFXBLURFILTER_H diff --git a/src/declarative/fx/qfxcomponentinstance.h b/src/declarative/fx/qfxcomponentinstance.h index e749272..f3bf6b3 100644 --- a/src/declarative/fx/qfxcomponentinstance.h +++ b/src/declarative/fx/qfxcomponentinstance.h @@ -44,12 +44,12 @@ #include <QtDeclarative/qfxitem.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxComponentInstancePrivate; class Q_DECLARATIVE_EXPORT QFxComponentInstance : public QFxItem { @@ -80,10 +80,11 @@ protected: private: Q_DECLARE_PRIVATE(QFxComponentInstance) }; -QML_DECLARE_TYPE(QFxComponentInstance) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxComponentInstance) + QT_END_HEADER #endif // QFXCOMPONENTINSTANCE_H diff --git a/src/declarative/fx/qfxcontentwrapper.h b/src/declarative/fx/qfxcontentwrapper.h index d8fe0b8..9a9a89c 100644 --- a/src/declarative/fx/qfxcontentwrapper.h +++ b/src/declarative/fx/qfxcontentwrapper.h @@ -44,12 +44,12 @@ #include <QtDeclarative/qfxitem.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxContentWrapperPrivate; class Q_DECLARATIVE_EXPORT QFxContentWrapper : public QFxItem { @@ -73,7 +73,6 @@ protected: private: Q_DECLARE_PRIVATE(QFxContentWrapper) }; -QML_DECLARE_TYPE(QFxContentWrapper) class Q_DECLARATIVE_EXPORT QFxContent : public QFxItem { @@ -81,10 +80,12 @@ class Q_DECLARATIVE_EXPORT QFxContent : public QFxItem public: QFxContent(QFxItem *parent=0) : QFxItem(parent) {} }; -QML_DECLARE_TYPE(QFxContent) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxContentWrapper) +QML_DECLARE_TYPE(QFxContent) + QT_END_HEADER #endif // QFXCONTENTWRAPPER_H diff --git a/src/declarative/fx/qfxevents_p.h b/src/declarative/fx/qfxevents_p.h index 60494e6..fbf0c5f 100644 --- a/src/declarative/fx/qfxevents_p.h +++ b/src/declarative/fx/qfxevents_p.h @@ -89,8 +89,6 @@ private: QKeyEvent event; }; -QML_DECLARE_TYPE(QFxKeyEvent) - class QFxMouseEvent : public QObject { Q_OBJECT @@ -131,8 +129,9 @@ private: bool _accepted; }; -QML_DECLARE_TYPE(QFxMouseEvent) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxKeyEvent) +QML_DECLARE_TYPE(QFxMouseEvent) + #endif // QFXEVENTS_P_H diff --git a/src/declarative/fx/qfxflickable.h b/src/declarative/fx/qfxflickable.h index 2c858bc..da38df8 100644 --- a/src/declarative/fx/qfxflickable.h +++ b/src/declarative/fx/qfxflickable.h @@ -44,12 +44,12 @@ #include <QtDeclarative/qfxitem.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxFlickablePrivate; class Q_DECLARATIVE_EXPORT QFxFlickable : public QFxItem { @@ -186,10 +186,11 @@ private: Q_DISABLE_COPY(QFxFlickable) Q_DECLARE_PRIVATE(QFxFlickable) }; -QML_DECLARE_TYPE(QFxFlickable) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxFlickable) + QT_END_HEADER + #endif diff --git a/src/declarative/fx/qfxflipable.cpp b/src/declarative/fx/qfxflipable.cpp index 9595724..7672858 100644 --- a/src/declarative/fx/qfxflipable.cpp +++ b/src/declarative/fx/qfxflipable.cpp @@ -44,6 +44,8 @@ #include "qfxtransform.h" #include <QtDeclarative/qmlinfo.h> +QT_BEGIN_NAMESPACE + QML_DEFINE_TYPE(QFxFlipable,Flipable) class QFxFlipablePrivate : public QFxItemPrivate diff --git a/src/declarative/fx/qfxflipable.h b/src/declarative/fx/qfxflipable.h index 6630633..06f8b93 100644 --- a/src/declarative/fx/qfxflipable.h +++ b/src/declarative/fx/qfxflipable.h @@ -97,10 +97,11 @@ private: Q_DISABLE_COPY(QFxFlipable) Q_DECLARE_PRIVATE(QFxFlipable) }; -QML_DECLARE_TYPE(QFxFlipable) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxFlipable) + QT_END_HEADER #endif // QFXFLIPABLE_H diff --git a/src/declarative/fx/qfxfocuspanel.h b/src/declarative/fx/qfxfocuspanel.h index 60f9118..623c9fb 100644 --- a/src/declarative/fx/qfxfocuspanel.h +++ b/src/declarative/fx/qfxfocuspanel.h @@ -44,12 +44,12 @@ #include <QtDeclarative/qfxitem.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class Q_DECLARATIVE_EXPORT QFxFocusPanel : public QFxItem { Q_OBJECT @@ -72,10 +72,10 @@ private: Q_DISABLE_COPY(QFxFocusPanel) }; -QML_DECLARE_TYPE(QFxFocusPanel) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxFocusPanel) + QT_END_HEADER #endif // QFXFOCUSPANEL_H diff --git a/src/declarative/fx/qfxfocusrealm.h b/src/declarative/fx/qfxfocusrealm.h index d2aadce..20fc5ad 100644 --- a/src/declarative/fx/qfxfocusrealm.h +++ b/src/declarative/fx/qfxfocusrealm.h @@ -44,12 +44,12 @@ #include <QtDeclarative/qfxitem.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class Q_DECLARATIVE_EXPORT QFxFocusRealm : public QFxItem { Q_OBJECT @@ -58,10 +58,10 @@ public: virtual ~QFxFocusRealm(); }; -QML_DECLARE_TYPE(QFxFocusRealm) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxFocusRealm) + QT_END_HEADER #endif // QFXFOCUSREALM_H diff --git a/src/declarative/fx/qfxgridview.h b/src/declarative/fx/qfxgridview.h index 19c21c4..b6d585e 100644 --- a/src/declarative/fx/qfxgridview.h +++ b/src/declarative/fx/qfxgridview.h @@ -139,10 +139,10 @@ private: void refill(); }; -QML_DECLARE_TYPE(QFxGridView) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxGridView) + QT_END_HEADER #endif diff --git a/src/declarative/fx/qfxhighlightfilter.h b/src/declarative/fx/qfxhighlightfilter.h index 33f0963..56509a3 100644 --- a/src/declarative/fx/qfxhighlightfilter.h +++ b/src/declarative/fx/qfxhighlightfilter.h @@ -45,12 +45,12 @@ #include <QtDeclarative/qsimplecanvasfilter.h> #include <QtDeclarative/qml.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxHighlightFilterPrivate; class Q_DECLARATIVE_EXPORT QFxHighlightFilter : public QSimpleCanvasFilter { @@ -89,10 +89,11 @@ protected: private: QFxHighlightFilterPrivate *d; }; -QML_DECLARE_TYPE(QFxHighlightFilter) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxHighlightFilter) + QT_END_HEADER #endif // QFXHIGHLIGHTFILTER_H diff --git a/src/declarative/fx/qfximage.h b/src/declarative/fx/qfximage.h index 35b921a..3071a9e 100644 --- a/src/declarative/fx/qfximage.h +++ b/src/declarative/fx/qfximage.h @@ -120,10 +120,11 @@ private: Q_DECLARE_PRIVATE(QFxImage) void setGridScaledImage(const QFxGridScaledImage& sci); }; -QML_DECLARE_TYPE(QFxImage) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxImage) + QT_END_HEADER #endif // QFXIMAGE_H diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp index 1c35290..7ccad5f 100644 --- a/src/declarative/fx/qfxitem.cpp +++ b/src/declarative/fx/qfxitem.cpp @@ -133,7 +133,9 @@ QFxContents::QFxContents() : m_height(0), m_width(0) The contents properties allow an item access to the size of its children. This property is useful if you have an item that needs to be - sized to fit its children. + sized to fit its children. +*/ + /*! \property QFxContents::height \brief The height of the contents. diff --git a/src/declarative/fx/qfxitem.h b/src/declarative/fx/qfxitem.h index 67a4553..2b45f73 100644 --- a/src/declarative/fx/qfxitem.h +++ b/src/declarative/fx/qfxitem.h @@ -86,7 +86,6 @@ private: qreal m_height; qreal m_width; }; -QML_DECLARE_TYPE(QFxContents) Q_DECLARE_OPERATORS_FOR_FLAGS(QFxAnchors::UsedAnchors) class QmlState; @@ -266,12 +265,13 @@ private: Q_DISABLE_COPY(QFxItem) Q_DECLARE_PRIVATE(QFxItem) }; -QML_DECLARE_TYPE(QFxItem) - -QML_DECLARE_TYPE(QSimpleCanvasFilter) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxContents) +QML_DECLARE_TYPE(QFxItem) +QML_DECLARE_TYPE(QSimpleCanvasFilter) + QT_END_HEADER #endif // QFXITEM_H diff --git a/src/declarative/fx/qfxkeyactions.h b/src/declarative/fx/qfxkeyactions.h index cea992a..91c2806 100644 --- a/src/declarative/fx/qfxkeyactions.h +++ b/src/declarative/fx/qfxkeyactions.h @@ -47,12 +47,12 @@ #include <QtDeclarative/qml.h> #include <QtDeclarative/qfxitem.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxKeyActionsPrivate; class Q_DECLARATIVE_EXPORT QFxKeyActions : public QFxItem { @@ -310,10 +310,10 @@ private: QFxKeyActionsPrivate *d; }; -QML_DECLARE_TYPE(QFxKeyActions) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxKeyActions) + QT_END_HEADER #endif // QFXKEYACTIONS_H diff --git a/src/declarative/fx/qfxkeyproxy.h b/src/declarative/fx/qfxkeyproxy.h index 38cff7a..d075295 100644 --- a/src/declarative/fx/qfxkeyproxy.h +++ b/src/declarative/fx/qfxkeyproxy.h @@ -49,6 +49,7 @@ QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxKeyProxyPrivate; class Q_DECLARATIVE_EXPORT QFxKeyProxy : public QFxItem { @@ -69,10 +70,10 @@ private: QFxKeyProxyPrivate *d; }; -QML_DECLARE_TYPE(QFxKeyProxy) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxKeyProxy) + QT_END_HEADER #endif // QFXKEYPROXY_H diff --git a/src/declarative/fx/qfxlayouts.h b/src/declarative/fx/qfxlayouts.h index b119d6f..112fe85 100644 --- a/src/declarative/fx/qfxlayouts.h +++ b/src/declarative/fx/qfxlayouts.h @@ -128,7 +128,6 @@ protected Q_SLOTS: private: Q_DISABLE_COPY(QFxVerticalLayout) }; -QML_DECLARE_TYPE(QFxVerticalLayout) class Q_DECLARATIVE_EXPORT QFxHorizontalLayout: public QFxBaseLayout { @@ -140,7 +139,6 @@ protected Q_SLOTS: private: Q_DISABLE_COPY(QFxHorizontalLayout) }; -QML_DECLARE_TYPE(QFxHorizontalLayout) class Q_DECLARATIVE_EXPORT QFxGridLayout : public QFxBaseLayout { @@ -163,9 +161,13 @@ private: int _columns; Q_DISABLE_COPY(QFxGridLayout) }; -QML_DECLARE_TYPE(QFxGridLayout) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxVerticalLayout) +QML_DECLARE_TYPE(QFxHorizontalLayout) +QML_DECLARE_TYPE(QFxGridLayout) + QT_END_HEADER + #endif diff --git a/src/declarative/fx/qfxlistview.h b/src/declarative/fx/qfxlistview.h index 5dfb0e4..6e9451e 100644 --- a/src/declarative/fx/qfxlistview.h +++ b/src/declarative/fx/qfxlistview.h @@ -44,12 +44,12 @@ #include <QtDeclarative/qfxflickable.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxVisualItemModel; class QFxListViewPrivate; class Q_DECLARATIVE_EXPORT QFxListView : public QFxFlickable @@ -145,10 +145,10 @@ private Q_SLOTS: void destroyingItem(QFxItem *item); }; -QML_DECLARE_TYPE(QFxListView) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxListView) + QT_END_HEADER #endif diff --git a/src/declarative/fx/qfxmouseregion.h b/src/declarative/fx/qfxmouseregion.h index d7db1dc..429ad00 100644 --- a/src/declarative/fx/qfxmouseregion.h +++ b/src/declarative/fx/qfxmouseregion.h @@ -86,7 +86,6 @@ private: int _ymax; Q_DISABLE_COPY(QFxDrag) }; -QML_DECLARE_TYPE(QFxDrag) class QFxMouseEvent; class QFxMouseRegionPrivate; @@ -154,10 +153,12 @@ private: Q_DISABLE_COPY(QFxMouseRegion) Q_DECLARE_PRIVATE(QFxMouseRegion) }; -QML_DECLARE_TYPE(QFxMouseRegion) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxDrag) +QML_DECLARE_TYPE(QFxMouseRegion) + QT_END_HEADER #endif // QFXMOUSEREGION_H diff --git a/src/declarative/fx/qfxpainteditem.h b/src/declarative/fx/qfxpainteditem.h index 6cb8fe7..7a0a9a9 100644 --- a/src/declarative/fx/qfxpainteditem.h +++ b/src/declarative/fx/qfxpainteditem.h @@ -101,10 +101,11 @@ private: Q_DISABLE_COPY(QFxPaintedItem) Q_DECLARE_PRIVATE(QFxPaintedItem) }; -QML_DECLARE_TYPE(QFxPaintedItem) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxPaintedItem) + QT_END_HEADER + #endif diff --git a/src/declarative/fx/qfxpath.h b/src/declarative/fx/qfxpath.h index 39b9d01..04d24c6 100644 --- a/src/declarative/fx/qfxpath.h +++ b/src/declarative/fx/qfxpath.h @@ -61,7 +61,6 @@ public: Q_SIGNALS: void changed(); }; -QML_DECLARE_TYPE(QFxPathElement) class Q_DECLARATIVE_EXPORT QFxPathAttribute : public QFxPathElement { @@ -83,7 +82,6 @@ private: QString _name; qreal _value; }; -QML_DECLARE_TYPE(QFxPathAttribute) class Q_DECLARATIVE_EXPORT QFxCurve : public QFxPathElement { @@ -106,7 +104,6 @@ private: qreal _x; qreal _y; }; -QML_DECLARE_TYPE(QFxCurve) class Q_DECLARATIVE_EXPORT QFxPathLine : public QFxCurve { @@ -116,7 +113,6 @@ public: void addToPath(QPainterPath &path); }; -QML_DECLARE_TYPE(QFxPathLine) class Q_DECLARATIVE_EXPORT QFxPathQuad : public QFxCurve { @@ -139,7 +135,6 @@ private: qreal _controlX; qreal _controlY; }; -QML_DECLARE_TYPE(QFxPathQuad) class Q_DECLARATIVE_EXPORT QFxPathCubic : public QFxCurve { @@ -172,7 +167,6 @@ private: int _control2X; int _control2Y; }; -QML_DECLARE_TYPE(QFxPathCubic) class Q_DECLARATIVE_EXPORT QFxPathPercent : public QFxPathElement { @@ -187,7 +181,6 @@ public: private: qreal _value; }; -QML_DECLARE_TYPE(QFxPathPercent) class QFxPathPrivate; class Q_DECLARATIVE_EXPORT QFxPath : public QObject, public QmlParserStatus @@ -249,9 +242,18 @@ private: Q_DISABLE_COPY(QFxPath) Q_DECLARE_PRIVATE(QFxPath) }; -QML_DECLARE_TYPE(QFxPath) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxPathElement) +QML_DECLARE_TYPE(QFxPathAttribute) +QML_DECLARE_TYPE(QFxCurve) +QML_DECLARE_TYPE(QFxPathLine) +QML_DECLARE_TYPE(QFxPathQuad) +QML_DECLARE_TYPE(QFxPathCubic) +QML_DECLARE_TYPE(QFxPathPercent) +QML_DECLARE_TYPE(QFxPath) + QT_END_HEADER + #endif // QFXPATH_H diff --git a/src/declarative/fx/qfxpathview.h b/src/declarative/fx/qfxpathview.h index cbdafa8..159c865 100644 --- a/src/declarative/fx/qfxpathview.h +++ b/src/declarative/fx/qfxpathview.h @@ -127,10 +127,11 @@ private: Q_DISABLE_COPY(QFxPathView) Q_DECLARE_PRIVATE(QFxPathView) }; -QML_DECLARE_TYPE(QFxPathView) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxPathView) + QT_END_HEADER #endif // QFXPATHVIEW_H diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp index 0536f12..b521d00 100644 --- a/src/declarative/fx/qfxrect.cpp +++ b/src/declarative/fx/qfxrect.cpp @@ -617,7 +617,7 @@ void QFxRect::drawRect(QPainter &p) if (d->gradient && d->gradient->gradient() /*|| p.usingQt() */) { // XXX This path is still slower than the image path // Image path won't work for gradients though - QPainter::RenderHints oldHints = p.renderHints(); + bool oldAA = p.testRenderHint(QPainter::Antialiasing); p.setRenderHint(QPainter::Antialiasing); if (d->pen && d->pen->isValid()) { QPen pn(QColor(d->pen->color()), d->pen->width()); @@ -630,7 +630,7 @@ void QFxRect::drawRect(QPainter &p) p.drawRoundedRect(0, 0, width(), height(), d->radius, d->radius); else p.drawRect(0, 0, width(), height()); - p.setRenderHints(oldHints); + p.setRenderHint(QPainter::Antialiasing, oldAA); } else { int offset = 0; const int pw = d->pen && d->pen->isValid() ? (d->pen->width()+1)/2*2 : 0; diff --git a/src/declarative/fx/qfxrect.h b/src/declarative/fx/qfxrect.h index df490b0..2b35d8d 100644 --- a/src/declarative/fx/qfxrect.h +++ b/src/declarative/fx/qfxrect.h @@ -77,7 +77,6 @@ private: QColor _color; bool _valid; }; -QML_DECLARE_TYPE(QFxPen) class Q_DECLARATIVE_EXPORT QFxGradientStop : public QObject { @@ -102,7 +101,6 @@ private: qreal m_position; QColor m_color; }; -QML_DECLARE_TYPE(QFxGradientStop) class Q_DECLARATIVE_EXPORT QFxGradient : public QObject { @@ -130,7 +128,6 @@ private: mutable QGradient *m_gradient; friend class QFxGradientStop; }; -QML_DECLARE_TYPE(QFxGradient) class QFxRectPrivate; class Q_DECLARATIVE_EXPORT QFxRect : public QFxItem @@ -184,10 +181,14 @@ private: Q_DISABLE_COPY(QFxRect) Q_DECLARE_PRIVATE(QFxRect) }; -QML_DECLARE_TYPE(QFxRect) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxPen) +QML_DECLARE_TYPE(QFxGradientStop) +QML_DECLARE_TYPE(QFxGradient) +QML_DECLARE_TYPE(QFxRect) + QT_END_HEADER #endif // QFXRECT_H diff --git a/src/declarative/fx/qfxreflectionfilter.h b/src/declarative/fx/qfxreflectionfilter.h index 6e56b5e..d862040 100644 --- a/src/declarative/fx/qfxreflectionfilter.h +++ b/src/declarative/fx/qfxreflectionfilter.h @@ -87,10 +87,11 @@ private: Q_DISABLE_COPY(QFxReflectionFilter) QFxReflectionFilterPrivate *d; }; -QML_DECLARE_TYPE(QFxReflectionFilter) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxReflectionFilter) + QT_END_HEADER #endif // QFXREFLECTIONFILTER_H diff --git a/src/declarative/fx/qfxrepeater.h b/src/declarative/fx/qfxrepeater.h index c1b194a..b82b9b0 100644 --- a/src/declarative/fx/qfxrepeater.h +++ b/src/declarative/fx/qfxrepeater.h @@ -44,12 +44,12 @@ #include <QtDeclarative/qfxitem.h> - QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Declarative) + class QFxRepeaterPrivate; class Q_DECLARATIVE_EXPORT QFxRepeater : public QFxItem { @@ -80,10 +80,11 @@ private: Q_DISABLE_COPY(QFxRepeater) Q_DECLARE_PRIVATE(QFxRepeater) }; -QML_DECLARE_TYPE(QFxRepeater) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxRepeater) + QT_END_HEADER -#endif // _QFXREPEATER_H_ +#endif // QFXREPEATER_H diff --git a/src/declarative/fx/qfxscalegrid.h b/src/declarative/fx/qfxscalegrid.h index c59cb32..03b2dd3 100644 --- a/src/declarative/fx/qfxscalegrid.h +++ b/src/declarative/fx/qfxscalegrid.h @@ -110,10 +110,11 @@ private: int _b; QString _pix; }; -QML_DECLARE_TYPE(QFxScaleGrid) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxScaleGrid) + QT_END_HEADER + #endif // QFXSCALEGRID_H diff --git a/src/declarative/fx/qfxshadowfilter.cpp b/src/declarative/fx/qfxshadowfilter.cpp index 10c332c..d37d565 100644 --- a/src/declarative/fx/qfxshadowfilter.cpp +++ b/src/declarative/fx/qfxshadowfilter.cpp @@ -47,9 +47,9 @@ #include <glbasicshaders.h> #endif -class QFxShadowFilterPrivate - QT_BEGIN_NAMESPACE + +class QFxShadowFilterPrivate { public: QFxShadowFilterPrivate() diff --git a/src/declarative/fx/qfxshadowfilter.h b/src/declarative/fx/qfxshadowfilter.h index 67d165a..1cbe54f 100644 --- a/src/declarative/fx/qfxshadowfilter.h +++ b/src/declarative/fx/qfxshadowfilter.h @@ -77,10 +77,11 @@ protected: private: QFxShadowFilterPrivate *d; }; -QML_DECLARE_TYPE(QFxShadowFilter) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxShadowFilter) + QT_END_HEADER -#endif // _QFXSHADOWFILTER_H_ + +#endif // QFXSHADOWFILTER_H diff --git a/src/declarative/fx/qfxtext.h b/src/declarative/fx/qfxtext.h index b929a6f..1f5a7b8 100644 --- a/src/declarative/fx/qfxtext.h +++ b/src/declarative/fx/qfxtext.h @@ -143,10 +143,11 @@ private: Q_DISABLE_COPY(QFxText) Q_DECLARE_PRIVATE(QFxText) }; -QML_DECLARE_TYPE(QFxText) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxText) + QT_END_HEADER + #endif diff --git a/src/declarative/fx/qfxtextedit.h b/src/declarative/fx/qfxtextedit.h index b761a1b..24ba3fe 100644 --- a/src/declarative/fx/qfxtextedit.h +++ b/src/declarative/fx/qfxtextedit.h @@ -202,10 +202,11 @@ private: Q_DISABLE_COPY(QFxTextEdit) Q_DECLARE_PRIVATE(QFxTextEdit) }; -QML_DECLARE_TYPE(QFxTextEdit) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxTextEdit) + QT_END_HEADER + #endif diff --git a/src/declarative/fx/qfxtransform.cpp b/src/declarative/fx/qfxtransform.cpp index a4c5d22..2c4f842 100644 --- a/src/declarative/fx/qfxtransform.cpp +++ b/src/declarative/fx/qfxtransform.cpp @@ -46,11 +46,11 @@ #include <math.h> #ifndef M_PI - -QT_BEGIN_NAMESPACE #define M_PI 3.14159265358979323846 #endif +QT_BEGIN_NAMESPACE + QML_DEFINE_NOCREATE_TYPE(QFxTransform); /*! diff --git a/src/declarative/fx/qfxtransform.h b/src/declarative/fx/qfxtransform.h index 7be8adc..8693e7b 100644 --- a/src/declarative/fx/qfxtransform.h +++ b/src/declarative/fx/qfxtransform.h @@ -67,7 +67,6 @@ public: virtual bool isIdentity() const; virtual QSimpleCanvas::Matrix transform() const; }; -QML_DECLARE_TYPE(QFxTransform) class Q_DECLARATIVE_EXPORT QFxAxis : public QObject { @@ -107,7 +106,6 @@ private: qreal _endY; qreal _endZ; }; -QML_DECLARE_TYPE(QFxAxis) class Q_DECLARATIVE_EXPORT QFxRotation : public QFxTransform { @@ -145,7 +143,6 @@ private: mutable bool _dirty; mutable QSimpleCanvas::Matrix _transform; }; -QML_DECLARE_TYPE(QFxRotation) class Q_DECLARATIVE_EXPORT QFxRotation3D : public QFxTransform { @@ -174,7 +171,6 @@ private: mutable bool _dirty; mutable QSimpleCanvas::Matrix _transform; }; -QML_DECLARE_TYPE(QFxRotation3D) class Q_DECLARATIVE_EXPORT QFxTranslation3D : public QFxTransform { @@ -203,7 +199,6 @@ private: mutable bool _dirty; mutable QSimpleCanvas::Matrix _transform; }; -QML_DECLARE_TYPE(QFxTranslation3D) class Q_DECLARATIVE_EXPORT QFxPerspective : public QFxTransform { @@ -244,7 +239,6 @@ private: qreal _angle; qreal _aspect; }; -QML_DECLARE_TYPE(QFxPerspective) class Q_DECLARATIVE_EXPORT QFxSquish : public QFxTransform { @@ -310,10 +304,17 @@ private: QSizeF s; QPointF p1, p2, p3, p4; }; -QML_DECLARE_TYPE(QFxSquish) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxTransform) +QML_DECLARE_TYPE(QFxAxis) +QML_DECLARE_TYPE(QFxRotation) +QML_DECLARE_TYPE(QFxRotation3D) +QML_DECLARE_TYPE(QFxTranslation3D) +QML_DECLARE_TYPE(QFxPerspective) +QML_DECLARE_TYPE(QFxSquish) + QT_END_HEADER #endif // QFXTRANSFORM_H diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp index c60a379..d3ab4cc 100644 --- a/src/declarative/fx/qfxvisualitemmodel.cpp +++ b/src/declarative/fx/qfxvisualitemmodel.cpp @@ -52,9 +52,9 @@ #include "qmllistaccessor.h" #include "qfxvisualitemmodel.h" +QML_DECLARE_TYPE(QListModelInterface) QT_BEGIN_NAMESPACE -QML_DECLARE_TYPE(QListModelInterface) class QFxVisualItemModelParts; class QFxVisualItemModelData; diff --git a/src/declarative/fx/qfxvisualitemmodel.h b/src/declarative/fx/qfxvisualitemmodel.h index 968cc2e..9cacde4 100644 --- a/src/declarative/fx/qfxvisualitemmodel.h +++ b/src/declarative/fx/qfxvisualitemmodel.h @@ -123,10 +123,11 @@ private Q_SLOTS: private: Q_DISABLE_COPY(QFxVisualItemModel) }; -QML_DECLARE_TYPE(QFxVisualItemModel) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxVisualItemModel) + QT_END_HEADER #endif // QFXVISUALITEMMODEL_H diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp index f4a06ce..3ab64bc 100644 --- a/src/declarative/fx/qfxwebview.cpp +++ b/src/declarative/fx/qfxwebview.cpp @@ -1010,6 +1010,6 @@ QObject *QFxWebPage::createPlugin(const QString &, const QUrl &url, const QStrin return new QWidget_Dummy_Plugin(comp,view(),paramNames,paramValues); } -#include "qfxwebview.moc" - QT_END_NAMESPACE + +#include "qfxwebview.moc" diff --git a/src/declarative/fx/qfxwebview.h b/src/declarative/fx/qfxwebview.h index 0ac1895..f5fd721 100644 --- a/src/declarative/fx/qfxwebview.h +++ b/src/declarative/fx/qfxwebview.h @@ -49,14 +49,14 @@ #include <QtNetwork/qnetworkaccessmanager.h> #include <QtWebKit/QWebPage> - QT_BEGIN_HEADER +class QWebHistory; +class QWebSettings; + QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -class QWebHistory; -class QWebSettings; class QFxWebViewPrivate; class QNetworkRequest; class QFxWebView; @@ -206,10 +206,11 @@ private: Q_DISABLE_COPY(QFxWebView) Q_DECLARE_PRIVATE(QFxWebView) }; -QML_DECLARE_TYPE(QFxWebView) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxWebView) + QT_END_HEADER + #endif diff --git a/src/declarative/fx/qfxwidgetcontainer.h b/src/declarative/fx/qfxwidgetcontainer.h index cc36010..862a280 100644 --- a/src/declarative/fx/qfxwidgetcontainer.h +++ b/src/declarative/fx/qfxwidgetcontainer.h @@ -72,10 +72,11 @@ protected: private: QGraphicsWidget *_graphicsWidget; }; -QML_DECLARE_TYPE(QFxWidgetContainer) QT_END_NAMESPACE +QML_DECLARE_TYPE(QFxWidgetContainer) + QT_END_HEADER #endif // QFXGRAPHICSWIDGET_H diff --git a/src/declarative/opengl/glbasicshaders.h b/src/declarative/opengl/glbasicshaders.h index 7d358d8..877f0fc 100644 --- a/src/declarative/opengl/glbasicshaders.h +++ b/src/declarative/opengl/glbasicshaders.h @@ -236,9 +236,8 @@ private: GLBasicShadersPrivate *d; }; -#endif // _GLBASICSHADERS_H_ - - QT_END_NAMESPACE QT_END_HEADER + +#endif // _GLBASICSHADERS_H_ diff --git a/src/declarative/qml/qml.h b/src/declarative/qml/qml.h index 51ca612..1990b7f 100644 --- a/src/declarative/qml/qml.h +++ b/src/declarative/qml/qml.h @@ -54,8 +54,6 @@ QT_BEGIN_HEADER -QT_BEGIN_NAMESPACE - QT_MODULE(Declarative) #define QML_DECLARE_TYPE(TYPE) \ @@ -73,6 +71,8 @@ QT_MODULE(Declarative) #define QML_DECLARE_INTERFACE_HASMETATYPE(INTERFACE) \ QML_DECLARE_TYPE_HASMETATYPE(INTERFACE) +QT_BEGIN_NAMESPACE + #define QML_DEFINE_INTERFACE(INTERFACE) \ template<> QmlPrivate::InstanceType QmlPrivate::Define<INTERFACE *>::instance(qmlRegisterInterface<INTERFACE>(#INTERFACE)); @@ -110,11 +110,11 @@ QObject *qmlAttachedPropertiesObject(const QObject *obj) return qmlAttachedPropertiesObjectById(idx, obj); } +QT_END_NAMESPACE + QML_DECLARE_TYPE(QObject) Q_DECLARE_METATYPE(QVariant) -QT_END_NAMESPACE - QT_END_HEADER #endif // QML_H diff --git a/src/declarative/qml/qmlbindablevalue.cpp b/src/declarative/qml/qmlbindablevalue.cpp index 222ea87..f447d4f 100644 --- a/src/declarative/qml/qmlbindablevalue.cpp +++ b/src/declarative/qml/qmlbindablevalue.cpp @@ -48,6 +48,8 @@ #include <qfxperf.h> #include <QtCore/qdebug.h> +Q_DECLARE_METATYPE(QList<QObject *>); + QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(scriptWarnings, QML_SCRIPT_WARNINGS); @@ -114,7 +116,6 @@ void QmlBindableValue::forceUpdate() update(); } -Q_DECLARE_METATYPE(QList<QObject *>); void QmlBindableValue::update() { Q_D(QmlBindableValue); diff --git a/src/declarative/qml/qmlbindablevalue.h b/src/declarative/qml/qmlbindablevalue.h index 00da57e..12da9f6 100644 --- a/src/declarative/qml/qmlbindablevalue.h +++ b/src/declarative/qml/qmlbindablevalue.h @@ -88,10 +88,11 @@ protected: private: Q_DECLARE_PRIVATE(QmlBindableValue) }; -QML_DECLARE_TYPE(QmlBindableValue) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlBindableValue) + QT_END_HEADER #endif // QMLBINDABLEVALUE_H diff --git a/src/declarative/qml/qmlboundsignal.cpp b/src/declarative/qml/qmlboundsignal.cpp index 5815dc6..9779e46 100644 --- a/src/declarative/qml/qmlboundsignal.cpp +++ b/src/declarative/qml/qmlboundsignal.cpp @@ -47,6 +47,7 @@ #include <qmlmetatype.h> #include <qml.h> #include <qmlcontext.h> +#include <QDebug> QT_BEGIN_NAMESPACE @@ -88,7 +89,6 @@ int QmlBoundSignalProxy::qt_metacall(QMetaObject::Call c, int id, void **a) } } -#include <QDebug> QmlBoundSignalParameters::QmlBoundSignalParameters(const QMetaMethod &method, QObject *parent) : QObject(parent), types(0), values(0) diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp index cb0c571..c2b2fb4 100644 --- a/src/declarative/qml/qmlcompiler.cpp +++ b/src/declarative/qml/qmlcompiler.cpp @@ -633,7 +633,7 @@ bool QmlCompiler::compileObject(Object *obj, const BindingContext &ctxt) if (isCustomParser) { // Custom parser types don't support signal properties if (testProperty(prop, obj)) { - if (deferred.contains(prop->name)) + if (deferred.contains(QString::fromLatin1(prop->name.constData()))) deferredProps << prop; else COMPILE_CHECK(compileProperty(prop, obj, objCtxt)); @@ -644,7 +644,7 @@ bool QmlCompiler::compileObject(Object *obj, const BindingContext &ctxt) if (isSignalPropertyName(prop->name)) { COMPILE_CHECK(compileSignal(prop,obj)); } else { - if (deferred.contains(prop->name)) + if (deferred.contains(QString::fromLatin1(prop->name.constData()))) deferredProps << prop; else COMPILE_CHECK(compileProperty(prop, obj, objCtxt)); @@ -660,7 +660,7 @@ bool QmlCompiler::compileObject(Object *obj, const BindingContext &ctxt) if (isCustomParser) { if (testProperty(prop, obj)) { QMetaProperty p = deferred.isEmpty()?QMetaProperty():QmlMetaType::defaultProperty(obj->metaObject()); - if (deferred.contains(p.name())) + if (deferred.contains(QString::fromLatin1(p.name()))) deferredProps << prop; else COMPILE_CHECK(compileProperty(prop, obj, objCtxt)); @@ -669,7 +669,7 @@ bool QmlCompiler::compileObject(Object *obj, const BindingContext &ctxt) } } else { QMetaProperty p = deferred.isEmpty()?QMetaProperty():QmlMetaType::defaultProperty(obj->metaObject()); - if (deferred.contains(p.name())) + if (deferred.contains(QString::fromLatin1(p.name()))) deferredProps << prop; else COMPILE_CHECK(compileProperty(prop, obj, objCtxt)); @@ -1683,7 +1683,7 @@ QStringList QmlCompiler::deferredProperties(QmlParser::Object *obj) return QStringList(); QMetaClassInfo classInfo = mo->classInfo(idx); - QStringList rv = QString(QLatin1String(classInfo.value())).split(','); + QStringList rv = QString(QLatin1String(classInfo.value())).split(QLatin1Char(',')); return rv; } diff --git a/src/declarative/qml/qmlcompiler_p.h b/src/declarative/qml/qmlcompiler_p.h index 2c722b9..819c4ad 100644 --- a/src/declarative/qml/qmlcompiler_p.h +++ b/src/declarative/qml/qmlcompiler_p.h @@ -61,9 +61,8 @@ #include <private/qmlcompositetypemanager_p.h> #include <private/qmlparser_p.h> -class QStringList; - QT_BEGIN_NAMESPACE + class QmlEngine; class QmlComponent; class QmlCompiledComponent; diff --git a/src/declarative/qml/qmlcomponent.h b/src/declarative/qml/qmlcomponent.h index 2e80b6b..db34e16 100644 --- a/src/declarative/qml/qmlcomponent.h +++ b/src/declarative/qml/qmlcomponent.h @@ -105,11 +105,12 @@ private: friend class QmlVME; friend struct QmlCompositeTypeData; }; -Q_DECLARE_METATYPE(QmlComponent::Status) -QML_DECLARE_TYPE(QmlComponent) QT_END_NAMESPACE +Q_DECLARE_METATYPE(QmlComponent::Status) +QML_DECLARE_TYPE(QmlComponent) + QT_END_HEADER #endif // QMLCOMPONENT_H diff --git a/src/declarative/qml/qmlcustomparser.cpp b/src/declarative/qml/qmlcustomparser.cpp index c90ab47..b543978 100644 --- a/src/declarative/qml/qmlcustomparser.cpp +++ b/src/declarative/qml/qmlcustomparser.cpp @@ -43,6 +43,8 @@ #include "qmlcustomparser_p_p.h" #include "qmlparser_p.h" +#include <QtCore/qdebug.h> + QT_BEGIN_NAMESPACE using namespace QmlParser; @@ -120,7 +122,6 @@ QmlCustomParserNodePrivate::fromObject(QmlParser::Object *root) return rootNode; } -#include <QtCore/qdebug.h> QmlCustomParserProperty QmlCustomParserNodePrivate::fromProperty(QmlParser::Property *p) { diff --git a/src/declarative/qml/qmlcustomparser_p.h b/src/declarative/qml/qmlcustomparser_p.h index 67f39d9..914ddbd 100644 --- a/src/declarative/qml/qmlcustomparser_p.h +++ b/src/declarative/qml/qmlcustomparser_p.h @@ -85,7 +85,6 @@ private: friend class QmlCustomParserPropertyPrivate; QmlCustomParserPropertyPrivate *d; }; -Q_DECLARE_METATYPE(QmlCustomParserProperty) class QmlCustomParserNodePrivate; class Q_DECLARATIVE_EXPORT QmlCustomParserNode @@ -104,7 +103,6 @@ private: friend class QmlCustomParserNodePrivate; QmlCustomParserNodePrivate *d; }; -Q_DECLARE_METATYPE(QmlCustomParserNode) class Q_DECLARATIVE_EXPORT QmlCustomParser { @@ -119,6 +117,9 @@ public: QT_END_NAMESPACE +Q_DECLARE_METATYPE(QmlCustomParserProperty) +Q_DECLARE_METATYPE(QmlCustomParserNode) + QT_END_HEADER #endif diff --git a/src/declarative/qml/qmldom.cpp b/src/declarative/qml/qmldom.cpp index 8497bea..9015e5c 100644 --- a/src/declarative/qml/qmldom.cpp +++ b/src/declarative/qml/qmldom.cpp @@ -278,6 +278,23 @@ QmlDomPropertyPrivate::~QmlDomPropertyPrivate() if (property) property->release(); } +QmlDomDynamicPropertyPrivate::QmlDomDynamicPropertyPrivate(): + valid(false) +{ +} + +QmlDomDynamicPropertyPrivate::QmlDomDynamicPropertyPrivate(const QmlDomDynamicPropertyPrivate &other) +: QSharedData(other), valid(other.valid) +{ + property = other.property; + if (valid && property.defaultValue) property.defaultValue->addref(); +} + +QmlDomDynamicPropertyPrivate::~QmlDomDynamicPropertyPrivate() +{ + if (valid && property.defaultValue) property.defaultValue->release(); +} + /*! \class QmlDomProperty \internal @@ -322,8 +339,8 @@ QmlDomProperty &QmlDomProperty::operator=(const QmlDomProperty &other) } /*! - Return the name of this property. - + Return the name of this property. + \qml Text { x: 10 @@ -331,7 +348,7 @@ Text { font.bold: true } \endqml - + As illustrated above, a property name can be a simple string, such as "x" or "y", or a more complex "dot property", such as "font.bold". In both cases the full name is returned ("x", "y" and "font.bold") by this method. @@ -358,7 +375,7 @@ Text { } \endqml - For each of the properties shown above, this method would return ("x"), + For each of the properties shown above, this method would return ("x"), ("y") and ("font", "bold"). \sa QmlDomProperty::propertyName() @@ -370,7 +387,7 @@ QList<QByteArray> QmlDomProperty::propertyNameParts() const } /*! - Return true if this property is used as a default property in the QML + Return true if this property is used as a default property in the QML document. \qml @@ -380,8 +397,8 @@ QList<QByteArray> QmlDomProperty::propertyNameParts() const The above two examples return the same DOM tree, except that the second has the default property flag set on the text property. Observe that whether - or not a property has isDefaultProperty set is determined by how the - property is used, and not only by whether the property is the types default + or not a property has isDefaultProperty set is determined by how the + property is used, and not only by whether the property is the types default property. */ bool QmlDomProperty::isDefaultProperty() const @@ -415,7 +432,7 @@ void QmlDomProperty::setValue(const QmlDomValue &value) } /*! - Returns the position in the input data where the property ID startd, or 0 if + Returns the position in the input data where the property ID startd, or -1 if the property is invalid. */ int QmlDomProperty::position() const @@ -423,19 +440,174 @@ int QmlDomProperty::position() const if (d && d->property) { return d->property->location.range.offset; } else - return 0; + return -1; } /*! Returns the length in the input data from where the property ID started upto - the end of it, or 0 if the property is invalid. + the end of it, or -1 if the property is invalid. */ int QmlDomProperty::length() const { if (d && d->property) return d->property->location.range.length; else - return 0; + return -1; +} + +/*! + Construct an invalid QmlDomDynamicProperty. +*/ +QmlDomDynamicProperty::QmlDomDynamicProperty(): + d(new QmlDomDynamicPropertyPrivate) +{ +} + +/*! + Create a copy of \a other QmlDomDynamicProperty. +*/ +QmlDomDynamicProperty::QmlDomDynamicProperty(const QmlDomDynamicProperty &other): + d(other.d) +{ +} + +/*! + Destroy the QmlDomDynamicProperty. +*/ +QmlDomDynamicProperty::~QmlDomDynamicProperty() +{ +} + +/*! + Assign \a other to this QmlDomDynamicProperty. +*/ +QmlDomDynamicProperty &QmlDomDynamicProperty::operator=(const QmlDomDynamicProperty &other) +{ + d = other.d; + return *this; +} + +bool QmlDomDynamicProperty::isValid() const +{ + return d && d->valid; +} + +/*! + Return the name of this dynamic property. + + \qml +Item { + property int count: 10; +} + \endqml + + As illustrated above, a dynamic property name can have a name and a + default value ("10"). +*/ +QByteArray QmlDomDynamicProperty::propertyName() const +{ + if (isValid()) + return d->property.name; + else + return QByteArray(); +} + +int QmlDomDynamicProperty::propertyType() const +{ + if (isValid()) { + switch (d->property.type) { + case QmlParser::Object::DynamicProperty::Bool: + return QMetaType::type("bool"); + + case QmlParser::Object::DynamicProperty::Color: + return QMetaType::type("QColor"); + + case QmlParser::Object::DynamicProperty::Date: + return QMetaType::type("QDateTime"); + + case QmlParser::Object::DynamicProperty::Int: + return QMetaType::type("int"); + + case QmlParser::Object::DynamicProperty::Real: + return QMetaType::type("double"); + + case QmlParser::Object::DynamicProperty::String: + return QMetaType::type("QString"); + + case QmlParser::Object::DynamicProperty::Url: + return QMetaType::type("QUrl"); + + case QmlParser::Object::DynamicProperty::Variant: + return QMetaType::type("QVariant"); + + default: + break; + } + } + + return -1; +} + +/*! + Return true if this property is used as a default property in the QML + document. + + \qml +<Text text="hello"/> +<Text>hello</Text> + \endqml + + The above two examples return the same DOM tree, except that the second has + the default property flag set on the text property. Observe that whether + or not a property has isDefaultProperty set is determined by how the + property is used, and not only by whether the property is the types default + property. +*/ +bool QmlDomDynamicProperty::isDefaultProperty() const +{ + if (isValid()) + return d->property.isDefaultProperty; + else + return false; +} + +/*! + Returns the default value as a QmlDomProperty. +*/ +QmlDomProperty QmlDomDynamicProperty::defaultValue() const +{ + QmlDomProperty rp; + + if (isValid() && d->property.defaultValue) { + rp.d->property = d->property.defaultValue; + rp.d->property->addref(); + } + + return rp; +} + +/*! + Returns the position in the input data where the property ID startd, or 0 if + the property is invalid. +*/ +int QmlDomDynamicProperty::position() const +{ + if (isValid()) { + return d->property.range.offset; + } else + return -1; +} + +/*! + Returns the length in the input data from where the property ID started upto + the end of it, or 0 if the property is invalid. +*/ +int QmlDomDynamicProperty::length() const +{ + if (isValid()) + return d->property.range.length; + else + return -1; } QmlDomObjectPrivate::QmlDomObjectPrivate() @@ -701,6 +873,41 @@ void QmlDomObject::addProperty(const QByteArray &name, const QmlDomValue &value) qWarning("QmlDomObject::addProperty(const QByteArray &, const QmlDomValue &): Not implemented"); } +QList<QmlDomDynamicProperty> QmlDomObject::dynamicProperties() const +{ + QList<QmlDomDynamicProperty> properties; + + for (int i = 0; i < d->object->dynamicProperties.size(); ++i) { + QmlDomDynamicProperty p; + p.d = new QmlDomDynamicPropertyPrivate; + p.d->property = d->object->dynamicProperties.at(i); + p.d->valid = true; + + if (p.d->property.defaultValue) + p.d->property.defaultValue->addref(); + + properties.append(p); + } + + return properties; +} + +QmlDomDynamicProperty QmlDomObject::dynamicProperty(const QByteArray &name) const +{ + QmlDomDynamicProperty p; + + for (int i = 0; i < d->object->dynamicProperties.size(); ++i) { + if (d->object->dynamicProperties.at(i).name == name) { + p.d = new QmlDomDynamicPropertyPrivate; + p.d->property = d->object->dynamicProperties.at(i); + if (p.d->property.defaultValue) p.d->property.defaultValue->addref(); + p.d->valid = true; + } + } + + return p; +} + /*! Returns true if this object is a custom type. Custom types are special types that allow embeddeding non-QML data, such as SVG or HTML data, @@ -769,26 +976,26 @@ QmlDomComponent QmlDomObject::toComponent() const /*! Returns the position in the input data where the property assignment started -, or 0 if the property is invalid. +, or -1 if the property is invalid. */ int QmlDomObject::position() const { if (d && d->object) return d->object->location.range.offset; else - return 0; + return -1; } /*! Returns the length in the input data from where the property assignment star -ted upto the end of it, or 0 if the property is invalid. +ted upto the end of it, or -1 if the property is invalid. */ int QmlDomObject::length() const { if (d && d->object) return d->object->location.range.length; else - return 0; + return -1; } // Returns the URL of the type, if it is an external type, or an empty URL if @@ -1323,25 +1530,25 @@ QmlDomList QmlDomValue::toList() const } /*! - Returns the position in the input data where the property value startd, or 0 + Returns the position in the input data where the property value startd, or -1 if the value is invalid. */ int QmlDomValue::position() const { if (type() == Invalid) - return 0; + return -1; else return d->value->location.range.offset; } /*! Returns the length in the input data from where the property value started u -pto the end of it, or 0 if the value is invalid. +pto the end of it, or -1 if the value is invalid. */ int QmlDomValue::length() const { if (type() == Invalid) - return 0; + return -1; else return d->value->location.range.length; } @@ -1436,7 +1643,7 @@ void QmlDomList::setValues(const QList<QmlDomValue> &values) } /*! - Returns the position in the input data where the list started, or 0 if + Returns the position in the input data where the list started, or -1 if the property is invalid. */ int QmlDomList::position() const @@ -1444,7 +1651,7 @@ int QmlDomList::position() const if (d && d->property) { return d->property->listValueRange.offset; } else - return 0; + return -1; } /*! @@ -1456,7 +1663,7 @@ int QmlDomList::length() const if (d && d->property) return d->property->listValueRange.length; else - return 0; + return -1; } /*! diff --git a/src/declarative/qml/qmldom.h b/src/declarative/qml/qmldom.h index ab3e39f..170ef56 100644 --- a/src/declarative/qml/qmldom.h +++ b/src/declarative/qml/qmldom.h @@ -107,9 +107,36 @@ public: private: friend class QmlDomObject; + friend class QmlDomDynamicProperty; QSharedDataPointer<QmlDomPropertyPrivate> d; }; +class QmlDomDynamicPropertyPrivate; +class Q_DECLARATIVE_EXPORT QmlDomDynamicProperty +{ +public: + QmlDomDynamicProperty(); + QmlDomDynamicProperty(const QmlDomDynamicProperty &); + ~QmlDomDynamicProperty(); + QmlDomDynamicProperty &operator=(const QmlDomDynamicProperty &); + + bool isValid() const; + + QByteArray propertyName() const; + int propertyType() const; + + bool isDefaultProperty() const; + + QmlDomProperty defaultValue() const; + + int position() const; + int length() const; + +private: + friend class QmlDomObject; + QSharedDataPointer<QmlDomDynamicPropertyPrivate> d; +}; + class QmlDomObjectPrivate; class Q_DECLARATIVE_EXPORT QmlDomObject { @@ -133,6 +160,9 @@ public: void removeProperty(const QByteArray &); void addProperty(const QByteArray &, const QmlDomValue &); + QList<QmlDomDynamicProperty> dynamicProperties() const; + QmlDomDynamicProperty dynamicProperty(const QByteArray &) const; + bool isCustomType() const; QByteArray customTypeData() const; void setCustomTypeData(const QByteArray &); diff --git a/src/declarative/qml/qmldom_p.h b/src/declarative/qml/qmldom_p.h index a7c3cc7..5345c44 100644 --- a/src/declarative/qml/qmldom_p.h +++ b/src/declarative/qml/qmldom_p.h @@ -54,15 +54,10 @@ // #include <QtCore/QtGlobal> - -QT_BEGIN_HEADER +#include "qmlparser_p.h" QT_BEGIN_NAMESPACE -QT_MODULE(Declarative) - -#include "qmlparser_p.h" - class QmlDomDocumentPrivate : public QSharedData { public: @@ -102,6 +97,17 @@ public: QmlParser::Property *property; }; +class QmlDomDynamicPropertyPrivate : public QSharedData +{ +public: + QmlDomDynamicPropertyPrivate(); + QmlDomDynamicPropertyPrivate(const QmlDomDynamicPropertyPrivate &); + ~QmlDomDynamicPropertyPrivate(); + + bool valid; + QmlParser::Object::DynamicProperty property; +}; + class QmlDomValuePrivate : public QSharedData { public: @@ -125,7 +131,5 @@ public: QT_END_NAMESPACE -QT_END_HEADER - #endif // QMLDOM_P_H diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp index 8c926b7..294e333 100644 --- a/src/declarative/qml/qmlengine.cpp +++ b/src/declarative/qml/qmlengine.cpp @@ -73,12 +73,13 @@ #include <private/qmlbindablevalue_p.h> #include <private/qmlvme_p.h> +Q_DECLARE_METATYPE(QmlMetaProperty) +Q_DECLARE_METATYPE(QList<QObject *>); + QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlDebugger, QML_DEBUGGER) -Q_DECLARE_METATYPE(QmlMetaProperty) - QML_DEFINE_TYPE(QObject,Object) static QScriptValue qmlMetaProperty_emit(QScriptContext *ctx, QScriptEngine *engine) @@ -1077,8 +1078,6 @@ void QmlExpression::valueChanged() { } -Q_DECLARE_METATYPE(QList<QObject *>); - void BindExpressionProxy::changed() { e->valueChanged(); @@ -1552,7 +1551,7 @@ QmlObjectScriptClass::QmlObjectScriptClass(QmlEngine *bindEngine) { engine = bindEngine; prototypeObject = engine->scriptEngine()->newObject(); - prototypeObject.setProperty("destroy", + prototypeObject.setProperty(QLatin1String("destroy"), engine->scriptEngine()->newFunction(QmlObjectDestroy)); } diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp index 218fdf8..448671e 100644 --- a/src/declarative/qml/qmlmetaproperty.cpp +++ b/src/declarative/qml/qmlmetaproperty.cpp @@ -50,6 +50,8 @@ #include <math.h> #include <QtCore/qdebug.h> +Q_DECLARE_METATYPE(QList<QObject *>); + QT_BEGIN_NAMESPACE class QMetaPropertyEx : public QMetaProperty @@ -651,8 +653,6 @@ QVariant QmlMetaProperty::read() const return QVariant(); } -Q_DECLARE_METATYPE(QList<QObject *>); - void QmlMetaPropertyPrivate::writeSignalProperty(const QVariant &value) { QString expr = value.toString(); diff --git a/src/declarative/qml/qmlmetaproperty_p.h b/src/declarative/qml/qmlmetaproperty_p.h index 3bd9089..69fd5c3 100644 --- a/src/declarative/qml/qmlmetaproperty_p.h +++ b/src/declarative/qml/qmlmetaproperty_p.h @@ -55,6 +55,8 @@ #include "qmlmetaproperty.h" +QT_BEGIN_NAMESPACE + class QmlContext; class QmlMetaPropertyPrivate { @@ -89,4 +91,6 @@ public: void writeValueProperty(const QVariant &); }; +QT_END_NAMESPACE + #endif // QMLMETAPROPERTY_P_H diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp index f69e5e5..b15f711 100644 --- a/src/declarative/qml/qmlmetatype.cpp +++ b/src/declarative/qml/qmlmetatype.cpp @@ -59,8 +59,6 @@ #include <QtCore/qcryptographichash.h> #include <private/qmlcustomparser_p.h> -QT_BEGIN_NAMESPACE - #ifdef QT_BOOTSTRAPPED # ifndef QT_NO_GEOM_VARIANT # define QT_NO_GEOM_VARIANT @@ -79,6 +77,8 @@ QT_BEGIN_NAMESPACE #endif #define NS(x) QT_PREPEND_NAMESPACE(x) +QT_BEGIN_NAMESPACE + struct QmlMetaTypeData { QList<QmlType *> types; diff --git a/src/declarative/qml/qmlparser.cpp b/src/declarative/qml/qmlparser.cpp index 5ad4a6e..6f0b0b7 100644 --- a/src/declarative/qml/qmlparser.cpp +++ b/src/declarative/qml/qmlparser.cpp @@ -113,7 +113,8 @@ QmlParser::Object::DynamicProperty::DynamicProperty(const DynamicProperty &o) : isDefaultProperty(o.isDefaultProperty), type(o.type), name(o.name), - defaultValue(o.defaultValue) + defaultValue(o.defaultValue), + range(o.range) { } diff --git a/src/declarative/qml/qmlparser_p.h b/src/declarative/qml/qmlparser_p.h index ef038f9..3aab066 100644 --- a/src/declarative/qml/qmlparser_p.h +++ b/src/declarative/qml/qmlparser_p.h @@ -150,6 +150,7 @@ namespace QmlParser Type type; QByteArray name; QmlParser::Property *defaultValue; + LocationRange range; }; struct DynamicSignal { DynamicSignal(); @@ -295,10 +296,11 @@ namespace QmlParser void dump(int = 0) const; }; } -Q_DECLARE_METATYPE(QmlParser::Variant) QT_END_NAMESPACE +Q_DECLARE_METATYPE(QmlParser::Variant) + QT_END_HEADER #endif // QMLPARSER_P_H diff --git a/src/declarative/qml/qmlpropertyvaluesource.h b/src/declarative/qml/qmlpropertyvaluesource.h index c142095..4e5f1c5 100644 --- a/src/declarative/qml/qmlpropertyvaluesource.h +++ b/src/declarative/qml/qmlpropertyvaluesource.h @@ -69,10 +69,11 @@ protected: private: Q_DISABLE_COPY(QmlPropertyValueSource) }; -QML_DECLARE_TYPE(QmlPropertyValueSource) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlPropertyValueSource) + QT_END_HEADER #endif // QMLPROPERTYVALUESOURCE_H diff --git a/src/declarative/qml/qmlproxymetaobject.cpp b/src/declarative/qml/qmlproxymetaobject.cpp index 5568bab..0baea31 100644 --- a/src/declarative/qml/qmlproxymetaobject.cpp +++ b/src/declarative/qml/qmlproxymetaobject.cpp @@ -41,6 +41,8 @@ #include "qmlproxymetaobject_p.h" +#include <QDebug> + QT_BEGIN_NAMESPACE QmlProxyMetaObject::QmlProxyMetaObject(QObject *obj, QList<ProxyData> *mList) @@ -78,7 +80,6 @@ QmlProxyMetaObject::~QmlProxyMetaObject() proxies = 0; } -#include <QDebug> int QmlProxyMetaObject::metaCall(QMetaObject::Call c, int id, void **a) { if ((c == QMetaObject::ReadProperty || diff --git a/src/declarative/qml/qmlscriptparser.cpp b/src/declarative/qml/qmlscriptparser.cpp index 24e26de..f1f1710 100644 --- a/src/declarative/qml/qmlscriptparser.cpp +++ b/src/declarative/qml/qmlscriptparser.cpp @@ -532,6 +532,8 @@ bool ProcessAST::visit(AST::UiPublicMember *node) property.isDefaultProperty = node->isDefaultMember; property.type = type; property.name = name.toUtf8(); + property.range.offset = node->firstSourceLocation().offset; + property.range.length = node->semicolonToken.end() - property.range.offset; if (node->expression) { // default value property.defaultValue = new Property; diff --git a/src/declarative/test/qfxtestengine.h b/src/declarative/test/qfxtestengine.h index 44a140f..bce8eec 100644 --- a/src/declarative/test/qfxtestengine.h +++ b/src/declarative/test/qfxtestengine.h @@ -77,9 +77,9 @@ private: QFxTestEnginePrivate *d; }; -#endif // _QFXTESTENGINE_H_ - QT_END_NAMESPACE QT_END_HEADER + +#endif // _QFXTESTENGINE_H_ diff --git a/src/declarative/test/qfxtestobjects.cpp b/src/declarative/test/qfxtestobjects.cpp index 12fc7fb..5035b28 100644 --- a/src/declarative/test/qfxtestobjects.cpp +++ b/src/declarative/test/qfxtestobjects.cpp @@ -45,19 +45,19 @@ #include <QDebug> #include <QTextStream> +QML_DECLARE_TYPE(TestObject) +QML_DECLARE_TYPE(TestFrame) +QML_DECLARE_TYPE(TestFullFrame) +QML_DECLARE_TYPE(TestMouse) +QML_DECLARE_TYPE(TestKey) +QML_DECLARE_TYPE(TestLog) QT_BEGIN_NAMESPACE -QML_DECLARE_TYPE(TestObject) QML_DEFINE_TYPE(TestObject,TestObject) -QML_DECLARE_TYPE(TestFrame) QML_DEFINE_TYPE(TestFrame,TestFrame) -QML_DECLARE_TYPE(TestFullFrame) QML_DEFINE_TYPE(TestFullFrame,TestFullFrame) -QML_DECLARE_TYPE(TestMouse) QML_DEFINE_TYPE(TestMouse,TestMouse) -QML_DECLARE_TYPE(TestKey) QML_DEFINE_TYPE(TestKey,TestKey) -QML_DECLARE_TYPE(TestLog) QML_DEFINE_TYPE(TestLog,TestLog) static QString padding(int pad) diff --git a/src/declarative/test/qfxtestobjects.h b/src/declarative/test/qfxtestobjects.h index 80fcfe7..c8686ad 100644 --- a/src/declarative/test/qfxtestobjects.h +++ b/src/declarative/test/qfxtestobjects.h @@ -204,9 +204,8 @@ private: QList<TestObject *> _actions; }; -#endif // _QFXTESTOBJECTS_H_ - - QT_END_NAMESPACE QT_END_HEADER + +#endif // _QFXTESTOBJECTS_H_ diff --git a/src/declarative/test/qfxtestview.h b/src/declarative/test/qfxtestview.h index a8f78bf..353494d 100644 --- a/src/declarative/test/qfxtestview.h +++ b/src/declarative/test/qfxtestview.h @@ -66,9 +66,8 @@ private: QFxTestEngine *testEngine; }; -#endif // _QFXTESTVIEW_H_ - - QT_END_NAMESPACE QT_END_HEADER + +#endif // _QFXTESTVIEW_H_ diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp index da26bdd..c4eabfe 100644 --- a/src/declarative/util/qmlanimation.cpp +++ b/src/declarative/util/qmlanimation.cpp @@ -1072,6 +1072,8 @@ void QmlSetPropertyAction::transition(QmlStateActions &actions, for (int jj = 0; jj < props.count(); ++jj) { Action myAction; myAction.property = d->createProperty(obj, props.at(jj)); + if (!myAction.property.isValid()) + continue; myAction.toValue = d->value; data->actions << myAction; } @@ -1895,6 +1897,8 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions, for (int jj = 0; jj < props.count(); ++jj) { Action myAction; myAction.property = d->createProperty(obj, props.at(jj)); + if (!myAction.property.isValid()) + continue; if (d->fromIsDefined) { d->convertVariant(d->from, (QVariant::Type)(d->interpolatorType ? d->interpolatorType : myAction.property.propertyType())); diff --git a/src/declarative/util/qmlanimation.h b/src/declarative/util/qmlanimation.h index 110c43e..12212df 100644 --- a/src/declarative/util/qmlanimation.h +++ b/src/declarative/util/qmlanimation.h @@ -134,8 +134,6 @@ private Q_SLOTS: void timelineComplete(); }; -QML_DECLARE_TYPE(QmlAbstractAnimation) - class QmlPauseAnimationPrivate; class QmlPauseAnimation : public QmlAbstractAnimation { @@ -158,7 +156,6 @@ protected: virtual QAbstractAnimation *qtAnimation(); virtual void prepare(QmlMetaProperty &); }; -QML_DECLARE_TYPE(QmlPauseAnimation) class QmlRunScriptActionPrivate; class QmlRunScriptAction : public QmlAbstractAnimation @@ -186,7 +183,6 @@ Q_SIGNALS: protected: virtual QAbstractAnimation *qtAnimation(); }; -QML_DECLARE_TYPE(QmlRunScriptAction) class QmlSetPropertyActionPrivate; class QmlSetPropertyAction : public QmlAbstractAnimation @@ -223,7 +219,6 @@ protected: virtual QAbstractAnimation *qtAnimation(); virtual void prepare(QmlMetaProperty &); }; -QML_DECLARE_TYPE(QmlSetPropertyAction) class QmlParentChangeActionPrivate; class QmlParentChangeAction : public QmlAbstractAnimation @@ -244,7 +239,6 @@ protected: virtual QAbstractAnimation *qtAnimation(); virtual void prepare(QmlMetaProperty &); }; -QML_DECLARE_TYPE(QmlParentChangeAction) class QmlPropertyAnimationPrivate; class QmlPropertyAnimation : public QmlAbstractAnimation @@ -296,7 +290,6 @@ Q_SIGNALS: void easingChanged(const QString &); void propertiesChanged(const QString &); }; -QML_DECLARE_TYPE(QmlPropertyAnimation) class QmlColorAnimation : public QmlPropertyAnimation { @@ -315,7 +308,6 @@ public: QColor to() const; void setTo(const QColor &); }; -QML_DECLARE_TYPE(QmlColorAnimation) class QmlNumberAnimation : public QmlPropertyAnimation { @@ -335,7 +327,6 @@ public: qreal to() const; void setTo(qreal); }; -QML_DECLARE_TYPE(QmlNumberAnimation) class QmlAnimationGroupPrivate; class QmlAnimationGroup : public QmlAbstractAnimation @@ -369,7 +360,6 @@ protected: virtual QAbstractAnimation *qtAnimation(); virtual void prepare(QmlMetaProperty &); }; -QML_DECLARE_TYPE(QmlSequentialAnimation) class QmlParallelAnimation : public QmlAnimationGroup { @@ -387,10 +377,20 @@ protected: virtual QAbstractAnimation *qtAnimation(); virtual void prepare(QmlMetaProperty &); }; -QML_DECLARE_TYPE(QmlParallelAnimation) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlAbstractAnimation) +QML_DECLARE_TYPE(QmlPauseAnimation) +QML_DECLARE_TYPE(QmlRunScriptAction) +QML_DECLARE_TYPE(QmlSetPropertyAction) +QML_DECLARE_TYPE(QmlParentChangeAction) +QML_DECLARE_TYPE(QmlPropertyAnimation) +QML_DECLARE_TYPE(QmlColorAnimation) +QML_DECLARE_TYPE(QmlNumberAnimation) +QML_DECLARE_TYPE(QmlSequentialAnimation) +QML_DECLARE_TYPE(QmlParallelAnimation) + QT_END_HEADER #endif // QMLANIMATION_H diff --git a/src/declarative/util/qmlbind.h b/src/declarative/util/qmlbind.h index b7b77f2..731cdf8 100644 --- a/src/declarative/util/qmlbind.h +++ b/src/declarative/util/qmlbind.h @@ -82,10 +82,11 @@ public: private: void eval(); }; -QML_DECLARE_TYPE(QmlBind) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlBind) + QT_END_HEADER #endif diff --git a/src/declarative/util/qmlconnection.h b/src/declarative/util/qmlconnection.h index d61659f..dcaac34 100644 --- a/src/declarative/util/qmlconnection.h +++ b/src/declarative/util/qmlconnection.h @@ -81,10 +81,11 @@ private: void connectIfValid(); void componentComplete(); }; -QML_DECLARE_TYPE(QmlConnection) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlConnection) + QT_END_HEADER #endif diff --git a/src/declarative/util/qmlfollow.h b/src/declarative/util/qmlfollow.h index 72d6df5..0953f2c 100644 --- a/src/declarative/util/qmlfollow.h +++ b/src/declarative/util/qmlfollow.h @@ -92,10 +92,10 @@ Q_SIGNALS: void valueChanged(qreal); }; -QML_DECLARE_TYPE(QmlFollow) - QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlFollow) + QT_END_HEADER #endif // QFXFOLLOW_H diff --git a/src/declarative/util/qmlfont.h b/src/declarative/util/qmlfont.h index c4c86e2..e85b8d3 100644 --- a/src/declarative/util/qmlfont.h +++ b/src/declarative/util/qmlfont.h @@ -83,10 +83,11 @@ public: Q_SIGNALS: void updated(); }; -QML_DECLARE_TYPE(QmlFont) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlFont) + QT_END_HEADER #endif // QMLFONT_H diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp index 1884e8b..c202a9f 100644 --- a/src/declarative/util/qmllistmodel.cpp +++ b/src/declarative/util/qmllistmodel.cpp @@ -49,6 +49,8 @@ #include <qmlbindablevalue.h> #include "qmllistmodel.h" +Q_DECLARE_METATYPE(QListModelInterface *) + QT_BEGIN_NAMESPACE #define DATA_ROLE_ID 1 @@ -67,8 +69,6 @@ struct ListModelData ListInstruction *instructions() const { return (ListInstruction *)((char *)this + sizeof(ListModelData)); } }; -Q_DECLARE_METATYPE(QListModelInterface *) - /*! \qmlclass ListModel \brief The ListModel element defines a free-form list data source. @@ -243,7 +243,6 @@ struct ModelNode ListModel *modelCache; ModelObject *objectCache; }; -Q_DECLARE_METATYPE(ModelNode *) ModelObject::ModelObject(ModelNode *node) : _node(node), _haveProperties(false), _mo(new QmlOpenMetaObject(this)) @@ -519,7 +518,6 @@ void ListModelParser::setCustomData(QObject *obj, const QByteArray &d) } } -QML_DECLARE_TYPE(ListModel) QML_DEFINE_CUSTOM_TYPE(ListModel, ListModel, ListModelParser) // ### FIXME @@ -527,7 +525,6 @@ class ListElement : public QObject { Q_OBJECT }; -QML_DECLARE_TYPE(ListElement) QML_DEFINE_TYPE(ListElement,ListElement) static void dump(ModelNode *node, int ind) @@ -568,4 +565,8 @@ ModelNode::~ModelNode() QT_END_NAMESPACE +Q_DECLARE_METATYPE(ModelNode *) +QML_DECLARE_TYPE(ListModel) +QML_DECLARE_TYPE(ListElement) + #include "qmllistmodel.moc" diff --git a/src/declarative/util/qmlpackage.h b/src/declarative/util/qmlpackage.h index 9f1d94f..9f7a623 100644 --- a/src/declarative/util/qmlpackage.h +++ b/src/declarative/util/qmlpackage.h @@ -77,10 +77,11 @@ public: static QmlPackageAttached *qmlAttachedProperties(QObject *); }; -QML_DECLARE_TYPE(QmlPackage) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlPackage) + QT_END_HEADER #endif // QMLPACKAGE_H diff --git a/src/declarative/util/qmlscript.h b/src/declarative/util/qmlscript.h index 5b62da5..4ba4f6b 100644 --- a/src/declarative/util/qmlscript.h +++ b/src/declarative/util/qmlscript.h @@ -74,10 +74,11 @@ public: private Q_SLOTS: void replyFinished(); }; -QML_DECLARE_TYPE(QmlScript) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlScript) + QT_END_HEADER #endif diff --git a/src/declarative/util/qmlsetproperties.h b/src/declarative/util/qmlsetproperties.h index 717d0ee..3632816 100644 --- a/src/declarative/util/qmlsetproperties.h +++ b/src/declarative/util/qmlsetproperties.h @@ -74,10 +74,11 @@ public: virtual ActionList actions(); }; -QML_DECLARE_TYPE(QmlSetProperties) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlSetProperties) + QT_END_HEADER #endif // QMLSETPROPERTIES_H diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp index 8ac1b33..8b096f0 100644 --- a/src/declarative/util/qmlstate.cpp +++ b/src/declarative/util/qmlstate.cpp @@ -525,7 +525,7 @@ void QmlState::apply(QmlStateGroup *group, QmlTransition *trans, QmlState *rever d->applyBindings(); //### merge into above foreach? } -QML_DEFINE_TYPE(QmlStateOperation,StateOperation) +QML_DEFINE_NOCREATE_TYPE(QmlStateOperation) QmlStateOperation::ActionList QmlStateOperation::actions() { return ActionList(); diff --git a/src/declarative/util/qmlstate.h b/src/declarative/util/qmlstate.h index b219b99..987c7ad 100644 --- a/src/declarative/util/qmlstate.h +++ b/src/declarative/util/qmlstate.h @@ -99,7 +99,6 @@ public: protected: QmlStateOperation(QObjectPrivate &dd, QObject *parent = 0); }; -QML_DECLARE_TYPE(QmlStateOperation) typedef QmlStateOperation::ActionList QmlStateActions; @@ -149,10 +148,12 @@ private: Q_DISABLE_COPY(QmlState) friend class QmlTransitionPrivate; }; -QML_DECLARE_TYPE(QmlState) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlStateOperation) +QML_DECLARE_TYPE(QmlState) + QT_END_HEADER #endif // QMLSTATE_H diff --git a/src/declarative/util/qmlstategroup.h b/src/declarative/util/qmlstategroup.h index 237b60e..a817bd0 100644 --- a/src/declarative/util/qmlstategroup.h +++ b/src/declarative/util/qmlstategroup.h @@ -85,10 +85,11 @@ private: friend class QmlState; void updateAutoState(); }; -QML_DECLARE_TYPE(QmlStateGroup) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlStateGroup) + QT_END_HEADER #endif // QMLSTATEGROUP_H diff --git a/src/declarative/util/qmlstateoperations.h b/src/declarative/util/qmlstateoperations.h index c7a6d42..6e5de48 100644 --- a/src/declarative/util/qmlstateoperations.h +++ b/src/declarative/util/qmlstateoperations.h @@ -70,7 +70,6 @@ public: virtual ActionList actions(); }; -QML_DECLARE_TYPE(QmlParentChange) class QmlRunScriptPrivate; class Q_DECLARATIVE_EXPORT QmlRunScript : public QmlStateOperation, public ActionEvent @@ -95,7 +94,6 @@ public: virtual void execute(); }; -QML_DECLARE_TYPE(QmlRunScript) class QmlSetPropertyPrivate; class Q_DECLARATIVE_EXPORT QmlSetProperty : public QmlStateOperation @@ -123,10 +121,13 @@ public: virtual ActionList actions(); }; -QML_DECLARE_TYPE(QmlSetProperty) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlParentChange) +QML_DECLARE_TYPE(QmlRunScript) +QML_DECLARE_TYPE(QmlSetProperty) + QT_END_HEADER #endif // QMLSTATEOPERATIONS_H diff --git a/src/declarative/util/qmltransition.h b/src/declarative/util/qmltransition.h index 4462b4c..d6cd513 100644 --- a/src/declarative/util/qmltransition.h +++ b/src/declarative/util/qmltransition.h @@ -88,10 +88,11 @@ public: void setReversed(bool r); void stop(); }; -QML_DECLARE_TYPE(QmlTransition) QT_END_NAMESPACE +QML_DECLARE_TYPE(QmlTransition) + QT_END_HEADER #endif // QMLTRANSITION_H diff --git a/src/declarative/widgets/graphicslayouts.h b/src/declarative/widgets/graphicslayouts.h index 525a848..ab8ad90 100644 --- a/src/declarative/widgets/graphicslayouts.h +++ b/src/declarative/widgets/graphicslayouts.h @@ -52,9 +52,6 @@ QT_BEGIN_NAMESPACE QT_MODULE(Declarative) -QML_DECLARE_INTERFACE(QGraphicsLayoutItem) -QML_DECLARE_INTERFACE(QGraphicsLayout) - class QGraphicsLinearLayoutStretchItemObject : public QObject, public QGraphicsLayoutItem { Q_OBJECT @@ -64,7 +61,6 @@ public: virtual QSizeF sizeHint(Qt::SizeHint, const QSizeF &) const; }; -QML_DECLARE_TYPE(QGraphicsLinearLayoutStretchItemObject) //TODO: // -content margins @@ -120,7 +116,6 @@ private: ChildList _children; }; -QML_DECLARE_TYPE(QGraphicsLinearLayoutObject) //TODO: // -content margins @@ -181,10 +176,15 @@ private: ChildList _children; }; -QML_DECLARE_TYPE(QGraphicsGridLayoutObject) QT_END_NAMESPACE +QML_DECLARE_INTERFACE(QGraphicsLayoutItem) +QML_DECLARE_INTERFACE(QGraphicsLayout) +QML_DECLARE_TYPE(QGraphicsLinearLayoutStretchItemObject) +QML_DECLARE_TYPE(QGraphicsLinearLayoutObject) +QML_DECLARE_TYPE(QGraphicsGridLayoutObject) + QT_END_HEADER #endif // GRAPHICSLAYOUTS_H diff --git a/src/declarative/widgets/graphicswidgets.h b/src/declarative/widgets/graphicswidgets.h index e29f1d6..8147400 100644 --- a/src/declarative/widgets/graphicswidgets.h +++ b/src/declarative/widgets/graphicswidgets.h @@ -48,13 +48,15 @@ #include <QtGui/QGraphicsWidget> #include <QtGui/QGraphicsItem> -QT_BEGIN_NAMESPACE +QT_BEGIN_HEADER + +QT_MODULE(Declarative) QML_DECLARE_TYPE(QGraphicsView) QML_DECLARE_TYPE_HASMETATYPE(QGraphicsScene) QML_DECLARE_TYPE(QGraphicsWidget) QML_DECLARE_INTERFACE_HASMETATYPE(QGraphicsItem) -QT_END_NAMESPACE +QT_END_HEADER #endif // GRAPHICSWIDGETS_H diff --git a/tests/auto/declarative/animations/data/badproperty1.qml b/tests/auto/declarative/animations/data/badproperty1.qml new file mode 100644 index 0000000..dc35775 --- /dev/null +++ b/tests/auto/declarative/animations/data/badproperty1.qml @@ -0,0 +1,22 @@ +Rect { + id: Wrapper + width: 240 + height: 320 + Rect { + id: MyRect + color: "red" + width: 50; height: 50 + x: 100; y: 100 + MouseRegion { + anchors.fill: parent + onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; + } + } + states: State { + name: "state1" + SetProperties { target: MyRect; pen.color: "blue" } + } + transitions: Transition { + ColorAnimation { target: MyRect; to: "red"; properties: "pen.colr"; duration: 1000 } + } +} diff --git a/tests/auto/declarative/animations/data/dotproperty.qml b/tests/auto/declarative/animations/data/dotproperty.qml new file mode 100644 index 0000000..2cfcefe --- /dev/null +++ b/tests/auto/declarative/animations/data/dotproperty.qml @@ -0,0 +1,22 @@ +Rect { + id: Wrapper + width: 240 + height: 320 + Rect { + id: MyRect + color: "red" + width: 50; height: 50 + x: 100; y: 100 + MouseRegion { + anchors.fill: parent + onClicked: if (Wrapper.state == "state1") Wrapper.state = ""; else Wrapper.state = "state1"; + } + } + states: State { + name: "state1" + SetProperties { target: MyRect; pen.color: "blue" } + } + transitions: Transition { + ColorAnimation { properties: "pen.color"; duration: 1000 } + } +} diff --git a/tests/auto/declarative/animations/tst_animations.cpp b/tests/auto/declarative/animations/tst_animations.cpp index 1895cef2..a493454 100644 --- a/tests/auto/declarative/animations/tst_animations.cpp +++ b/tests/auto/declarative/animations/tst_animations.cpp @@ -12,6 +12,7 @@ public: private slots: void badTypes(); + void badProperties(); //void mixedTypes(); }; @@ -51,6 +52,20 @@ void tst_animations::badTypes() } } +void tst_animations::badProperties() +{ + //don't crash (should be runtime error) + { + QFxView *view = new QFxView; + view->setUrl(QUrl("file://" SRCDIR "/data/badproperty1.qml")); + + view->execute(); + qApp->processEvents(); + + delete view; + } +} + /*//test animating mixed types with property animation //for example, int + real; color + real; etc void tst_animations::mixedTypes() diff --git a/tools/linguist/lupdate/qml.cpp b/tools/linguist/lupdate/qml.cpp index f33eae3..f66a6bd 100644 --- a/tools/linguist/lupdate/qml.cpp +++ b/tools/linguist/lupdate/qml.cpp @@ -47,8 +47,6 @@ #include <QtCore/QFile> #include <QtCore/QString> -QT_BEGIN_NAMESPACE - #include "parser/qmljsengine_p.h" #include "parser/qmljsparser_p.h" #include "parser/qmljslexer_p.h" @@ -65,6 +63,8 @@ QT_BEGIN_NAMESPACE #include <iostream> #include <cstdlib> +QT_BEGIN_NAMESPACE + using namespace QmlJS; class FindTrCalls: protected AST::Visitor diff --git a/tools/qmldebugger/canvasframerate.cpp b/tools/qmldebugger/canvasframerate.cpp index 022aed5..f2a813d 100644 --- a/tools/qmldebugger/canvasframerate.cpp +++ b/tools/qmldebugger/canvasframerate.cpp @@ -14,6 +14,8 @@ #include <QLineEdit> #include <QCheckBox> +QT_BEGIN_NAMESPACE + class QLineGraph : public QWidget { Q_OBJECT @@ -301,4 +303,6 @@ void CanvasFrameRate::stateChanged(int s) static_cast<QmlDebugClientPlugin *>(m_plugin)->setEnabled(checked); } +QT_END_NAMESPACE + #include "canvasframerate.moc" diff --git a/tools/qmldebugger/canvasframerate.h b/tools/qmldebugger/canvasframerate.h index 543f233..cc40d4c 100644 --- a/tools/qmldebugger/canvasframerate.h +++ b/tools/qmldebugger/canvasframerate.h @@ -3,6 +3,8 @@ #include <QWidget> +QT_BEGIN_NAMESPACE + class QmlDebugClient; class QTabWidget; class CanvasFrameRate : public QWidget @@ -20,5 +22,7 @@ private: QObject *m_plugin; }; +QT_END_NAMESPACE + #endif // CANVASFRAMERATE_H diff --git a/tools/qmldebugger/canvasscene.cpp b/tools/qmldebugger/canvasscene.cpp index 2d5b764..95f3098 100644 --- a/tools/qmldebugger/canvasscene.cpp +++ b/tools/qmldebugger/canvasscene.cpp @@ -8,6 +8,8 @@ #include <QtDeclarative/qfxrect.h> #include <QtDeclarative/qfximage.h> +QT_BEGIN_NAMESPACE + class CanvasSceneClientPlugin : public QmlDebugClientPlugin { public: @@ -243,3 +245,4 @@ void CanvasScene::setY(int y) m_canvasRoot->setY(y); } +QT_END_NAMESPACE diff --git a/tools/qmldebugger/canvasscene.h b/tools/qmldebugger/canvasscene.h index d980241..8b583e8 100644 --- a/tools/qmldebugger/canvasscene.h +++ b/tools/qmldebugger/canvasscene.h @@ -6,6 +6,8 @@ #include <QtDeclarative/qsimplecanvas.h> #include <QtDeclarative/qsimplecanvasitem.h> +QT_BEGIN_NAMESPACE + class QmlDebugClient; class CanvasSceneClient; class QmlDebugClientPlugin; @@ -35,5 +37,7 @@ private: QTreeWidgetItem *m_selected; }; +QT_END_NAMESPACE + #endif // CANVASSCENE_H diff --git a/tools/qmlviewer/qmlviewer.cpp b/tools/qmlviewer/qmlviewer.cpp index 21cadda..cb7d00c 100644 --- a/tools/qmlviewer/qmlviewer.cpp +++ b/tools/qmlviewer/qmlviewer.cpp @@ -41,6 +41,8 @@ #include <QTimer> #include <QNetworkProxyFactory> +QT_BEGIN_NAMESPACE + class PreviewDeviceSkin : public DeviceSkin { Q_OBJECT @@ -711,4 +713,6 @@ void QmlViewer::setCacheEnabled(bool on) } } +QT_END_NAMESPACE + #include "qmlviewer.moc" diff --git a/tools/qmlviewer/qmlviewer.h b/tools/qmlviewer/qmlviewer.h index 9de47a8..c533fe0 100644 --- a/tools/qmlviewer/qmlviewer.h +++ b/tools/qmlviewer/qmlviewer.h @@ -20,6 +20,7 @@ #include <qfxtestengine.h> #include <QList> +QT_BEGIN_NAMESPACE class QFxView; class PreviewDeviceSkin; @@ -94,4 +95,6 @@ private: QFxTestEngine *testEngine; }; +QT_END_NAMESPACE + #endif |