summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/declarative/extra/qfxanimatedimageitem.cpp2
-rw-r--r--src/declarative/extra/qfxflowview.cpp4
-rw-r--r--src/declarative/extra/qfxintegermodel.cpp2
-rw-r--r--src/declarative/extra/qfxparticles.cpp10
-rw-r--r--src/declarative/extra/qmlbehaviour.cpp2
-rw-r--r--src/declarative/extra/qmldatetimeformatter.cpp2
-rw-r--r--src/declarative/extra/qmlfolderlistmodel.cpp2
-rw-r--r--src/declarative/extra/qmlnumberformatter.cpp2
-rw-r--r--src/declarative/extra/qmlsqlconnection.cpp2
-rw-r--r--src/declarative/extra/qmlsqlquery.cpp4
-rw-r--r--src/declarative/extra/qmlxmllistmodel.cpp4
-rw-r--r--src/declarative/fx/qfxanchors.cpp2
-rw-r--r--src/declarative/fx/qfxcomponentinstance.cpp2
-rw-r--r--src/declarative/fx/qfxflickable.cpp2
-rw-r--r--src/declarative/fx/qfxflipable.cpp2
-rw-r--r--src/declarative/fx/qfxfocusrealm.cpp2
-rw-r--r--src/declarative/fx/qfxgraphicsobjectcontainer.cpp2
-rw-r--r--src/declarative/fx/qfxgridview.cpp4
-rw-r--r--src/declarative/fx/qfximage.cpp2
-rw-r--r--src/declarative/fx/qfxitem.cpp2
-rw-r--r--src/declarative/fx/qfxkeyactions.cpp2
-rw-r--r--src/declarative/fx/qfxkeyproxy.cpp2
-rw-r--r--src/declarative/fx/qfxlayouts.cpp6
-rw-r--r--src/declarative/fx/qfxlineedit.cpp4
-rw-r--r--src/declarative/fx/qfxlistview.cpp2
-rw-r--r--src/declarative/fx/qfxmouseregion.cpp4
-rw-r--r--src/declarative/fx/qfxpath.cpp12
-rw-r--r--src/declarative/fx/qfxpathview.cpp2
-rw-r--r--src/declarative/fx/qfxrect.cpp8
-rw-r--r--src/declarative/fx/qfxrepeater.cpp2
-rw-r--r--src/declarative/fx/qfxtext.cpp2
-rw-r--r--src/declarative/fx/qfxtextedit.cpp2
-rw-r--r--src/declarative/fx/qfxtransform.cpp14
-rw-r--r--src/declarative/fx/qfxvisualitemmodel.cpp2
-rw-r--r--src/declarative/fx/qfxwebview.cpp2
-rw-r--r--src/declarative/qml/qml.h8
-rw-r--r--src/declarative/qml/qmlcomponent.cpp2
-rw-r--r--src/declarative/qml/qmlcustomparser_p.h4
-rw-r--r--src/declarative/qml/qmlengine.cpp2
-rw-r--r--src/declarative/qml/qmlmetatype.cpp61
-rw-r--r--src/declarative/qml/qmlmetatype.h17
-rw-r--r--src/declarative/util/qmlanimation.cpp18
-rw-r--r--src/declarative/util/qmlbind.cpp2
-rw-r--r--src/declarative/util/qmlconnection.cpp2
-rw-r--r--src/declarative/util/qmlfollow.cpp2
-rw-r--r--src/declarative/util/qmlfont.cpp2
-rw-r--r--src/declarative/util/qmllistmodel.cpp4
-rw-r--r--src/declarative/util/qmlpackage.cpp2
-rw-r--r--src/declarative/util/qmlpalette.cpp2
-rw-r--r--src/declarative/util/qmlscript.cpp2
-rw-r--r--src/declarative/util/qmlsetproperties.cpp2
-rw-r--r--src/declarative/util/qmlstate.cpp2
-rw-r--r--src/declarative/util/qmlstategroup.cpp2
-rw-r--r--src/declarative/util/qmlstateoperations.cpp4
-rw-r--r--src/declarative/util/qmltimer.cpp2
-rw-r--r--src/declarative/util/qmltransition.cpp2
-rw-r--r--src/declarative/widgets/graphicslayouts.cpp6
-rw-r--r--src/declarative/widgets/graphicswidgets.cpp6
58 files changed, 154 insertions, 124 deletions
diff --git a/src/declarative/extra/qfxanimatedimageitem.cpp b/src/declarative/extra/qfxanimatedimageitem.cpp
index c4b949a..44a1d67 100644
--- a/src/declarative/extra/qfxanimatedimageitem.cpp
+++ b/src/declarative/extra/qfxanimatedimageitem.cpp
@@ -77,7 +77,7 @@ Item {
\endqml
\endtable
*/
-QML_DEFINE_TYPE(Qt,4.6,AnimatedImage,QFxAnimatedImageItem)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,AnimatedImage,QFxAnimatedImageItem)
QFxAnimatedImageItem::QFxAnimatedImageItem(QFxItem *parent)
: QFxImage(*(new QFxAnimatedImageItemPrivate), parent)
diff --git a/src/declarative/extra/qfxflowview.cpp b/src/declarative/extra/qfxflowview.cpp
index a0fde47..1757c5a 100644
--- a/src/declarative/extra/qfxflowview.cpp
+++ b/src/declarative/extra/qfxflowview.cpp
@@ -1,5 +1,3 @@
-import Qt 4.6
-
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
@@ -375,7 +373,7 @@ void QFxFlowView::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
}
-QML_DEFINE_TYPE(QFxFlowView,FlowView);
+QML_DEFINE_TYPE(Qt, 4,6, (QT_VERSION&0x00ff00)>>8, FlowView, QFxFlowView);
QT_END_NAMESPACE
diff --git a/src/declarative/extra/qfxintegermodel.cpp b/src/declarative/extra/qfxintegermodel.cpp
index f536fee..3cd46d7 100644
--- a/src/declarative/extra/qfxintegermodel.cpp
+++ b/src/declarative/extra/qfxintegermodel.cpp
@@ -43,7 +43,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,IntegerModel,QFxIntegerModel)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,IntegerModel,QFxIntegerModel)
class QFxIntegerModelPrivate
{
diff --git a/src/declarative/extra/qfxparticles.cpp b/src/declarative/extra/qfxparticles.cpp
index 9f7319f..13c14b0 100644
--- a/src/declarative/extra/qfxparticles.cpp
+++ b/src/declarative/extra/qfxparticles.cpp
@@ -102,7 +102,7 @@ public:
//---------------------------------------------------------------------------
-QML_DEFINE_TYPE(Qt,4.6,ParticleMotion,QFxParticleMotion)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotion,QFxParticleMotion)
/*!
\class QFxParticleMotion
@@ -162,7 +162,7 @@ void QFxParticleMotion::destroy(QFxParticle &particle)
\brief The QFxParticleMotionLinear class moves the particles linearly.
*/
-QML_DEFINE_TYPE(Qt,4.6,ParticleMotionLinear,QFxParticleMotionLinear)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionLinear,QFxParticleMotionLinear)
void QFxParticleMotionLinear::advance(QFxParticle &p, int interval)
{
@@ -184,7 +184,7 @@ void QFxParticleMotionLinear::advance(QFxParticle &p, int interval)
\brief The QFxParticleMotionGravity class moves the particles towards a point.
*/
-QML_DEFINE_TYPE(Qt,4.6,ParticleMotionGravity,QFxParticleMotionGravity)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionGravity,QFxParticleMotionGravity)
/*!
\qmlproperty int ParticleMotionGravity::xattractor
@@ -286,7 +286,7 @@ Rect {
This property holds how quickly the paricles will move from side to side.
*/
-QML_DEFINE_TYPE(Qt,4.6,ParticleMotionWander,QFxParticleMotionWander)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParticleMotionWander,QFxParticleMotionWander)
void QFxParticleMotionWander::advance(QFxParticle &p, int interval)
{
@@ -528,7 +528,7 @@ void QFxParticlesPrivate::updateOpacity(QFxParticle &p, int age)
}
}
-QML_DEFINE_TYPE(Qt,4.6,Particles,QFxParticles)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Particles,QFxParticles)
/*!
\qmlclass Particles
diff --git a/src/declarative/extra/qmlbehaviour.cpp b/src/declarative/extra/qmlbehaviour.cpp
index 7f82b1a..0e70bdc 100644
--- a/src/declarative/extra/qmlbehaviour.cpp
+++ b/src/declarative/extra/qmlbehaviour.cpp
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Behavior,QmlBehaviour)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Behavior,QmlBehaviour)
class QmlBehaviourData : public QObject
{
diff --git a/src/declarative/extra/qmldatetimeformatter.cpp b/src/declarative/extra/qmldatetimeformatter.cpp
index 08f73cf..91ebce6 100644
--- a/src/declarative/extra/qmldatetimeformatter.cpp
+++ b/src/declarative/extra/qmldatetimeformatter.cpp
@@ -365,6 +365,6 @@ void QmlDateTimeFormatter::classComplete()
d->updateText();
}
-QML_DEFINE_TYPE(Qt,4.6,DateTimeFormatter,QmlDateTimeFormatter)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,DateTimeFormatter,QmlDateTimeFormatter)
QT_END_NAMESPACE
diff --git a/src/declarative/extra/qmlfolderlistmodel.cpp b/src/declarative/extra/qmlfolderlistmodel.cpp
index 4f36bbf..d28f7bd 100644
--- a/src/declarative/extra/qmlfolderlistmodel.cpp
+++ b/src/declarative/extra/qmlfolderlistmodel.cpp
@@ -207,7 +207,7 @@ void QmlFolderListModel::dataChanged(const QModelIndex &start, const QModelIndex
emit itemsChanged(start.row(), end.row() - start.row() + 1, roles());
}
-QML_DEFINE_TYPE(Qt,4.6,FolderListModel,QmlFolderListModel)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,FolderListModel,QmlFolderListModel)
QT_END_NAMESPACE
diff --git a/src/declarative/extra/qmlnumberformatter.cpp b/src/declarative/extra/qmlnumberformatter.cpp
index bcb9eed..1818c36 100644
--- a/src/declarative/extra/qmlnumberformatter.cpp
+++ b/src/declarative/extra/qmlnumberformatter.cpp
@@ -210,6 +210,6 @@ void QmlNumberFormatter::classComplete()
d->classComplete = true;
d->updateText();
}
-QML_DEFINE_TYPE(Qt,4.6,NumberFormatter,QmlNumberFormatter);
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,NumberFormatter,QmlNumberFormatter);
QT_END_NAMESPACE
diff --git a/src/declarative/extra/qmlsqlconnection.cpp b/src/declarative/extra/qmlsqlconnection.cpp
index 55af930..3384ccd 100644
--- a/src/declarative/extra/qmlsqlconnection.cpp
+++ b/src/declarative/extra/qmlsqlconnection.cpp
@@ -51,7 +51,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,SqlConnection,QmlSqlConnection)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SqlConnection,QmlSqlConnection)
class QmlSqlConnectionPrivate: public QObjectPrivate
{
diff --git a/src/declarative/extra/qmlsqlquery.cpp b/src/declarative/extra/qmlsqlquery.cpp
index fb49bd5..4894de7 100644
--- a/src/declarative/extra/qmlsqlquery.cpp
+++ b/src/declarative/extra/qmlsqlquery.cpp
@@ -56,8 +56,8 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,SqlBind,QmlSqlBind)
-QML_DEFINE_TYPE(Qt,4.6,SqlQuery,QmlSqlQuery)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SqlBind,QmlSqlBind)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SqlQuery,QmlSqlQuery)
class QmlSqlBindPrivate : public QObjectPrivate
{
diff --git a/src/declarative/extra/qmlxmllistmodel.cpp b/src/declarative/extra/qmlxmllistmodel.cpp
index f142b7c..b1ad127 100644
--- a/src/declarative/extra/qmlxmllistmodel.cpp
+++ b/src/declarative/extra/qmlxmllistmodel.cpp
@@ -58,8 +58,8 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,XmlRole,XmlListModelRole)
-QML_DEFINE_TYPE(Qt,4.6,XmlListModel,QmlXmlListModel)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,XmlRole,XmlListModelRole)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,XmlListModel,QmlXmlListModel)
class QmlXmlListModelPrivate;
struct QmlXmlRoleList : public QmlConcreteList<XmlListModelRole *>
diff --git a/src/declarative/fx/qfxanchors.cpp b/src/declarative/fx/qfxanchors.cpp
index 700bc01..9704fef 100644
--- a/src/declarative/fx/qfxanchors.cpp
+++ b/src/declarative/fx/qfxanchors.cpp
@@ -47,7 +47,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Anchors,QFxAnchors)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Anchors,QFxAnchors)
//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/fx/qfxcomponentinstance.cpp b/src/declarative/fx/qfxcomponentinstance.cpp
index 2876459..3ea45bd 100644
--- a/src/declarative/fx/qfxcomponentinstance.cpp
+++ b/src/declarative/fx/qfxcomponentinstance.cpp
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,ComponentInstance,QFxComponentInstance)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ComponentInstance,QFxComponentInstance)
/*!
\internal
diff --git a/src/declarative/fx/qfxflickable.cpp b/src/declarative/fx/qfxflickable.cpp
index 3329ea6..d94c6d8 100644
--- a/src/declarative/fx/qfxflickable.cpp
+++ b/src/declarative/fx/qfxflickable.cpp
@@ -228,7 +228,7 @@ void QFxFlickablePrivate::updateBeginningEnd()
static const int FlickThreshold = 5;
-QML_DEFINE_TYPE(Qt,4.6,Flickable,QFxFlickable)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Flickable,QFxFlickable)
/*!
\qmlclass Flickable
diff --git a/src/declarative/fx/qfxflipable.cpp b/src/declarative/fx/qfxflipable.cpp
index 0383051..fafd04a 100644
--- a/src/declarative/fx/qfxflipable.cpp
+++ b/src/declarative/fx/qfxflipable.cpp
@@ -46,7 +46,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Flipable,QFxFlipable)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Flipable,QFxFlipable)
class QFxFlipablePrivate : public QFxItemPrivate
{
diff --git a/src/declarative/fx/qfxfocusrealm.cpp b/src/declarative/fx/qfxfocusrealm.cpp
index 04beaad..e22d721 100644
--- a/src/declarative/fx/qfxfocusrealm.cpp
+++ b/src/declarative/fx/qfxfocusrealm.cpp
@@ -43,7 +43,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,FocusRealm,QFxFocusRealm)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,FocusRealm,QFxFocusRealm)
/*!
\qmlclass FocusRealm
diff --git a/src/declarative/fx/qfxgraphicsobjectcontainer.cpp b/src/declarative/fx/qfxgraphicsobjectcontainer.cpp
index f3f2e0d..08120fc 100644
--- a/src/declarative/fx/qfxgraphicsobjectcontainer.cpp
+++ b/src/declarative/fx/qfxgraphicsobjectcontainer.cpp
@@ -56,7 +56,7 @@ QT_BEGIN_NAMESPACE
*/
QML_DEFINE_NOCREATE_TYPE(QGraphicsObject)
-QML_DEFINE_TYPE(Qt,4.6,GraphicsObjectContainer,QFxGraphicsObjectContainer)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,GraphicsObjectContainer,QFxGraphicsObjectContainer)
QFxGraphicsObjectContainer::QFxGraphicsObjectContainer(QFxItem *parent)
: QFxItem(parent), _graphicsObject(0)
diff --git a/src/declarative/fx/qfxgridview.cpp b/src/declarative/fx/qfxgridview.cpp
index f3a43e2..a91ddc6 100644
--- a/src/declarative/fx/qfxgridview.cpp
+++ b/src/declarative/fx/qfxgridview.cpp
@@ -1,5 +1,3 @@
-import Qt 4.6
-
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
@@ -1428,7 +1426,7 @@ QObject *QFxGridView::qmlAttachedProperties(QObject *obj)
return QFxGridViewAttached::properties(obj);
}
-QML_DEFINE_TYPE(QFxGridView,GridView)
+QML_DEFINE_TYPE(Qt, 4,6, (QT_VERSION&0x00ff00)>>8, GridView, QFxGridView)
QT_END_NAMESPACE
diff --git a/src/declarative/fx/qfximage.cpp b/src/declarative/fx/qfximage.cpp
index 738809c..e54dd9b 100644
--- a/src/declarative/fx/qfximage.cpp
+++ b/src/declarative/fx/qfximage.cpp
@@ -53,7 +53,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Image,QFxImage)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Image,QFxImage)
/*!
\qmlclass Image QFxImage
diff --git a/src/declarative/fx/qfxitem.cpp b/src/declarative/fx/qfxitem.cpp
index 34af32a..6c6fcd3 100644
--- a/src/declarative/fx/qfxitem.cpp
+++ b/src/declarative/fx/qfxitem.cpp
@@ -71,7 +71,7 @@ QT_BEGIN_NAMESPACE
#endif
QML_DEFINE_NOCREATE_TYPE(QFxContents)
-QML_DEFINE_TYPE(Qt,4.6,Item,QFxItem)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Item,QFxItem)
/*!
\group group_animation
diff --git a/src/declarative/fx/qfxkeyactions.cpp b/src/declarative/fx/qfxkeyactions.cpp
index 892b3ca..186ab45 100644
--- a/src/declarative/fx/qfxkeyactions.cpp
+++ b/src/declarative/fx/qfxkeyactions.cpp
@@ -44,7 +44,7 @@
#include <QKeyEvent>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,KeyActions,QFxKeyActions)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,KeyActions,QFxKeyActions)
class QFxKeyActionsPrivate
{
diff --git a/src/declarative/fx/qfxkeyproxy.cpp b/src/declarative/fx/qfxkeyproxy.cpp
index 714e979..13f4bfb 100644
--- a/src/declarative/fx/qfxkeyproxy.cpp
+++ b/src/declarative/fx/qfxkeyproxy.cpp
@@ -45,7 +45,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,KeyProxy,QFxKeyProxy)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,KeyProxy,QFxKeyProxy)
/*!
\qmlclass KeyProxy
diff --git a/src/declarative/fx/qfxlayouts.cpp b/src/declarative/fx/qfxlayouts.cpp
index c098dfc..3e8a64c 100644
--- a/src/declarative/fx/qfxlayouts.cpp
+++ b/src/declarative/fx/qfxlayouts.cpp
@@ -445,7 +445,7 @@ void QFxBaseLayout::applyRemove(const QList<QPair<QString, QVariant> >& changes,
applyTransition(changes,target, remove());
}
-QML_DEFINE_TYPE(Qt,4.6,VerticalLayout,QFxVerticalLayout)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,VerticalLayout,QFxVerticalLayout)
/*!
\qmlclass VerticalLayout
\brief The VerticalLayout item arranges its children in a vertical layout.
@@ -648,7 +648,7 @@ void QFxVerticalLayout::doLayout()
setMovingItem(0);
}
-QML_DEFINE_TYPE(Qt,4.6,HorizontalLayout,QFxHorizontalLayout)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,HorizontalLayout,QFxHorizontalLayout)
/*!
\qmlclass HorizontalLayout
\brief The HorizontalLayout item arranges its children in a horizontal layout.
@@ -813,7 +813,7 @@ void QFxHorizontalLayout::doLayout()
setWidth(hoffset);
}
-QML_DEFINE_TYPE(Qt,4.6,GridLayout,QFxGridLayout)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,GridLayout,QFxGridLayout)
/*!
\qmlclass GridLayout QFxGridLayout
diff --git a/src/declarative/fx/qfxlineedit.cpp b/src/declarative/fx/qfxlineedit.cpp
index 4e2a56e..c77942d 100644
--- a/src/declarative/fx/qfxlineedit.cpp
+++ b/src/declarative/fx/qfxlineedit.cpp
@@ -47,8 +47,8 @@
#include <QPainter>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,LineEdit,QFxLineEdit);
-QML_DEFINE_TYPE(Qt,4.6,QIntValidator,QIntValidator);
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,LineEdit,QFxLineEdit);
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QIntValidator,QIntValidator);
QFxLineEdit::QFxLineEdit(QFxItem* parent)
: QFxPaintedItem(*(new QFxLineEditPrivate), parent)
diff --git a/src/declarative/fx/qfxlistview.cpp b/src/declarative/fx/qfxlistview.cpp
index 54e46cf..db80967 100644
--- a/src/declarative/fx/qfxlistview.cpp
+++ b/src/declarative/fx/qfxlistview.cpp
@@ -1643,7 +1643,7 @@ QObject *QFxListView::qmlAttachedProperties(QObject *obj)
return QFxListViewAttached::properties(obj);
}
-QML_DEFINE_TYPE(Qt,4.6,ListView,QFxListView)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ListView,QFxListView)
QT_END_NAMESPACE
#include "qfxlistview.moc"
diff --git a/src/declarative/fx/qfxmouseregion.cpp b/src/declarative/fx/qfxmouseregion.cpp
index c476994a..d7bb7c9 100644
--- a/src/declarative/fx/qfxmouseregion.cpp
+++ b/src/declarative/fx/qfxmouseregion.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
static const int DragThreshold = 5;
static const int PressAndHoldDelay = 800;
-QML_DEFINE_TYPE(Qt,4.6,Drag,QFxDrag)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Drag,QFxDrag)
QFxDrag::QFxDrag(QObject *parent)
: QObject(parent), _target(0), _xmin(0), _xmax(0), _ymin(0), _ymax(0)
{
@@ -233,7 +233,7 @@ void QFxDrag::setYmax(int m)
position of the release of the click, and whether the click wasHeld.
*/
-QML_DEFINE_TYPE(Qt,4.6,MouseRegion,QFxMouseRegion)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,MouseRegion,QFxMouseRegion)
/*!
\internal
diff --git a/src/declarative/fx/qfxpath.cpp b/src/declarative/fx/qfxpath.cpp
index b4376a1..aff8a6d 100644
--- a/src/declarative/fx/qfxpath.cpp
+++ b/src/declarative/fx/qfxpath.cpp
@@ -47,14 +47,14 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Path,QFxPath)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Path,QFxPath)
QML_DEFINE_NOCREATE_TYPE(QFxPathElement)
QML_DEFINE_NOCREATE_TYPE(QFxCurve)
-QML_DEFINE_TYPE(Qt,4.6,PathAttribute,QFxPathAttribute)
-QML_DEFINE_TYPE(Qt,4.6,PathPercent,QFxPathPercent)
-QML_DEFINE_TYPE(Qt,4.6,PathLine,QFxPathLine)
-QML_DEFINE_TYPE(Qt,4.6,PathQuad,QFxPathQuad)
-QML_DEFINE_TYPE(Qt,4.6,PathCubic,QFxPathCubic)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PathAttribute,QFxPathAttribute)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PathPercent,QFxPathPercent)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PathLine,QFxPathLine)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PathQuad,QFxPathQuad)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PathCubic,QFxPathCubic)
/*!
\qmlclass PathElement
diff --git a/src/declarative/fx/qfxpathview.cpp b/src/declarative/fx/qfxpathview.cpp
index 1d4e278..2a36c25 100644
--- a/src/declarative/fx/qfxpathview.cpp
+++ b/src/declarative/fx/qfxpathview.cpp
@@ -54,7 +54,7 @@ static const int FlickThreshold = 5;
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,PathView,QFxPathView)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PathView,QFxPathView)
class QFxPathViewAttached : public QObject
{
diff --git a/src/declarative/fx/qfxrect.cpp b/src/declarative/fx/qfxrect.cpp
index fb22c98..7010ba1 100644
--- a/src/declarative/fx/qfxrect.cpp
+++ b/src/declarative/fx/qfxrect.cpp
@@ -45,9 +45,9 @@
#include <QPainter>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Pen,QFxPen)
-QML_DEFINE_TYPE(Qt,4.6,GradientStop,QFxGradientStop)
-QML_DEFINE_TYPE(Qt,4.6,Gradient,QFxGradient)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Pen,QFxPen)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,GradientStop,QFxGradientStop)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Gradient,QFxGradient)
/*!
\internal
@@ -185,7 +185,7 @@ void QFxGradient::doUpdate()
emit updated();
}
-QML_DEFINE_TYPE(Qt,4.6,Rect,QFxRect)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rect,QFxRect)
/*!
\qmlclass Rect QFxRect
diff --git a/src/declarative/fx/qfxrepeater.cpp b/src/declarative/fx/qfxrepeater.cpp
index 97683eb..084921b 100644
--- a/src/declarative/fx/qfxrepeater.cpp
+++ b/src/declarative/fx/qfxrepeater.cpp
@@ -72,7 +72,7 @@ QFxItem *QFxRepeaterPrivate::addItem(QmlContext *ctxt, QFxItem *lastItem)
return item;
}
-QML_DEFINE_TYPE(Qt,4.6,Repeater,QFxRepeater)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Repeater,QFxRepeater)
/*!
\qmlclass Repeater
diff --git a/src/declarative/fx/qfxtext.cpp b/src/declarative/fx/qfxtext.cpp
index 4215e27..e0692e9 100644
--- a/src/declarative/fx/qfxtext.cpp
+++ b/src/declarative/fx/qfxtext.cpp
@@ -52,7 +52,7 @@
#include <QPainter>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Text,QFxText)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Text,QFxText)
/*!
\qmlclass Text QFxText
diff --git a/src/declarative/fx/qfxtextedit.cpp b/src/declarative/fx/qfxtextedit.cpp
index 8ff753e..fbb2d53 100644
--- a/src/declarative/fx/qfxtextedit.cpp
+++ b/src/declarative/fx/qfxtextedit.cpp
@@ -53,7 +53,7 @@
#include <QPainter>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,TextEdit,QFxTextEdit)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,TextEdit,QFxTextEdit)
/*!
\qmlclass TextEdit
diff --git a/src/declarative/fx/qfxtransform.cpp b/src/declarative/fx/qfxtransform.cpp
index 7bdd5c1..9fc66ef 100644
--- a/src/declarative/fx/qfxtransform.cpp
+++ b/src/declarative/fx/qfxtransform.cpp
@@ -199,7 +199,7 @@ void QFxScale::update()
QFxTransform::update();
}
-QML_DEFINE_TYPE(Qt,4.6,Scale,QFxScale)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Scale,QFxScale)
/*!
@@ -218,7 +218,7 @@ QML_DEFINE_TYPE(Qt,4.6,Scale,QFxScale)
\endqml
*/
-QML_DEFINE_TYPE(Qt,4.6,Axis,QFxAxis)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Axis,QFxAxis)
QFxAxis::QFxAxis(QObject *parent)
: QObject(parent), _startX(0), _startY(0), _endX(0), _endY(0), _endZ(0)
@@ -391,7 +391,7 @@ void QFxRotation::update()
QFxTransform::update();
}
-QML_DEFINE_TYPE(Qt,4.6,Rotation,QFxRotation)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rotation,QFxRotation)
/*!
\qmlclass Rotation3D
@@ -403,7 +403,7 @@ QML_DEFINE_TYPE(Qt,4.6,Rotation,QFxRotation)
\image axisrotation.png
*/
-QML_DEFINE_TYPE(Qt,4.6,Rotation3D,QFxRotation3D)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Rotation3D,QFxRotation3D)
QFxRotation3D::QFxRotation3D(QObject *parent)
: QFxTransform(parent), _angle(0), _dirty(true)
@@ -529,7 +529,7 @@ Image {
\endqml
*/
-QML_DEFINE_TYPE(Qt,4.6,Translation3D,QFxTranslation3D)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Translation3D,QFxTranslation3D)
QFxTranslation3D::QFxTranslation3D(QObject *parent)
: QFxTransform(parent), _distance(0), _dirty(true)
@@ -627,7 +627,7 @@ void QFxTranslation3D::update()
OpenGL. When running under software rasterization it has no effect.
*/
-QML_DEFINE_TYPE(Qt,4.6,Perspective,QFxPerspective)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Perspective,QFxPerspective)
QFxPerspective::QFxPerspective(QObject *parent)
: QFxTransform(parent)
@@ -724,7 +724,7 @@ QFxPerspective::~QFxPerspective()
\image squish.png
*/
-QML_DEFINE_TYPE(Qt,4.6,Squish,QFxSquish)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Squish,QFxSquish)
QFxSquish::QFxSquish(QObject *parent)
: QFxTransform(parent)
diff --git a/src/declarative/fx/qfxvisualitemmodel.cpp b/src/declarative/fx/qfxvisualitemmodel.cpp
index ee94831..b653057 100644
--- a/src/declarative/fx/qfxvisualitemmodel.cpp
+++ b/src/declarative/fx/qfxvisualitemmodel.cpp
@@ -767,7 +767,7 @@ void QFxVisualItemModel::_q_destroyingPackage(QmlPackage *package)
emit destroyingItem(qobject_cast<QFxItem*>(package->part(d->m_part)));
}
-QML_DEFINE_TYPE(Qt,4.6,VisualModel,QFxVisualItemModel)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,VisualModel,QFxVisualItemModel)
QT_END_NAMESPACE
#include "qfxvisualitemmodel.moc"
diff --git a/src/declarative/fx/qfxwebview.cpp b/src/declarative/fx/qfxwebview.cpp
index 667dc7b..4c6af69 100644
--- a/src/declarative/fx/qfxwebview.cpp
+++ b/src/declarative/fx/qfxwebview.cpp
@@ -63,7 +63,7 @@
#include <private/qfxpainteditem_p.h>
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,WebView,QFxWebView)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,WebView,QFxWebView)
static const int MAX_DOUBLECLICK_TIME=500; // XXX need better gesture system
diff --git a/src/declarative/qml/qml.h b/src/declarative/qml/qml.h
index 5dd57bc..e7fbff3 100644
--- a/src/declarative/qml/qml.h
+++ b/src/declarative/qml/qml.h
@@ -76,11 +76,11 @@ QT_BEGIN_NAMESPACE
#define QML_DEFINE_INTERFACE(INTERFACE) \
template<> QmlPrivate::InstanceType QmlPrivate::Define<INTERFACE *>::instance(qmlRegisterInterface<INTERFACE>(#INTERFACE));
-#define QML_DEFINE_EXTENDED_TYPE(URI, VERSION, NAME, TYPE, EXTENSION) \
- template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *>::instance(qmlRegisterExtendedType<TYPE,EXTENSION>(#URI, #VERSION, #NAME, #TYPE));
+#define QML_DEFINE_EXTENDED_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MIN_TO, NAME, TYPE, EXTENSION) \
+ template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *>::instance(qmlRegisterExtendedType<TYPE,EXTENSION>(#URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MIN_TO, #NAME, #TYPE));
-#define QML_DEFINE_TYPE(URI, VERSION, NAME, TYPE) \
- template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *>::instance(qmlRegisterType<TYPE>(#URI, #VERSION, #NAME, #TYPE));
+#define QML_DEFINE_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MIN_TO, NAME, TYPE) \
+ template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *>::instance(qmlRegisterType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MIN_TO, #NAME, #TYPE));
#define QML_DEFINE_EXTENDED_NOCREATE_TYPE(TYPE, EXTENSION) \
template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *>::instance(qmlRegisterExtendedType<TYPE,EXTENSION>(#TYPE));
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp
index 4de114d..d5afaeb 100644
--- a/src/declarative/qml/qmlcomponent.cpp
+++ b/src/declarative/qml/qmlcomponent.cpp
@@ -95,7 +95,7 @@ Item {
}
\endqml
*/
-QML_DEFINE_TYPE(Qt,4.6,Component,QmlComponent);
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Component,QmlComponent);
/*!
\enum QmlComponent::Status
diff --git a/src/declarative/qml/qmlcustomparser_p.h b/src/declarative/qml/qmlcustomparser_p.h
index 63144d6..3d55d3e 100644
--- a/src/declarative/qml/qmlcustomparser_p.h
+++ b/src/declarative/qml/qmlcustomparser_p.h
@@ -112,8 +112,8 @@ public:
virtual QByteArray compile(const QList<QmlCustomParserProperty> &, bool *ok);
virtual void setCustomData(QObject *, const QByteArray &);
};
-#define QML_DEFINE_CUSTOM_TYPE(URI, VERSION, NAME, TYPE, CUSTOMTYPE) \
- template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *>::instance(qmlRegisterCustomType<TYPE>(#URI, #VERSION, #NAME, #TYPE, new CUSTOMTYPE));
+#define QML_DEFINE_CUSTOM_TYPE(URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, NAME, TYPE, CUSTOMTYPE) \
+ template<> QmlPrivate::InstanceType QmlPrivate::Define<TYPE *>::instance(qmlRegisterCustomType<TYPE>(#URI, VERSION_MAJ, VERSION_MIN_FROM, VERSION_MAJ_TO, #NAME, #TYPE, new CUSTOMTYPE));
QT_END_NAMESPACE
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index 492be3b..2589a16 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -85,7 +85,7 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(qmlDebugger, QML_DEBUGGER)
DEFINE_BOOL_CONFIG_OPTION(qmlImportTrace, QML_IMPORT_TRACE)
-QML_DEFINE_TYPE(Qt,4.6,Object,QObject)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Object,QObject)
struct StaticQtMetaObject : public QObject
{
diff --git a/src/declarative/qml/qmlmetatype.cpp b/src/declarative/qml/qmlmetatype.cpp
index bb05ebd..f65ead8 100644
--- a/src/declarative/qml/qmlmetatype.cpp
+++ b/src/declarative/qml/qmlmetatype.cpp
@@ -417,31 +417,62 @@ int QmlMetaType::registerInterface(const QmlPrivate::MetaTypeIds &id,
return index;
}
-int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Func func, const char *uri, const char *version, const char *cname, const QMetaObject *mo, QmlAttachedPropertiesFunc attach, const QMetaObject *attachMo, int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *parser)
+int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Func func,
+ const char *uri, int version_maj, int version_min_from, int version_min_to, const char *cname,
+ const QMetaObject *mo, QmlAttachedPropertiesFunc attach, const QMetaObject *attachMo,
+ int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *parser)
+{
+ QByteArray version;
+ if (uri && (version_maj || version_min_from || version_min_to)) {
+ if (version_min_from != version_min_to) {
+ int r=-1;
+ for (int min=version_min_from; min<=version_min_to; ++min) {
+ int e = registerType(id,func,uri,version_maj,min,min,cname,mo,attach,attachMo,pStatus,object,extFunc,extmo,parser);
+ if (e<0) return -1;
+ if (r<0) r = e;
+ }
+ return r; // returns index of FIRST version of type (not currently used anywhere though)
+ }
+ version = QByteArray::number(version_maj) + '.' + QByteArray::number(version_min_from);
+ } else {
+ // No URI? No version!
+ Q_ASSERT(!version_maj && !version_min_from && !version_min_to);
+ }
+ return registerType(id,func,uri,version,cname,mo,attach,attachMo,pStatus,object,extFunc,extmo,parser);
+}
+
+
+int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Func func,
+ const char *uri, const char *version, const char *cname,
+ const QMetaObject *mo, QmlAttachedPropertiesFunc attach, const QMetaObject *attachMo,
+ int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *parser)
{
Q_UNUSED(object);
- QWriteLocker lock(metaTypeDataLock());
- QmlMetaTypeData *data = metaTypeData();
-
QByteArray name = cname;
- for (int ii = 0; ii < name.count(); ++ii) {
- if (!isalnum(name.at(ii))) {
- qWarning("QmlMetaType: Invalid QML name %s", cname);
- return -1;
- }
- }
-
- // XXX Only adding specified version. Need all relevant versions!
if (uri) {
- if (version)
+ if (version) {
name = QByteArray(uri) + '/' + version + '/' + name;
- else
+ } else {
name = QByteArray(uri) + '/' + name;
+ }
} else {
+ // No URI? No version!
Q_ASSERT(!version);
}
+ if (cname) {
+ for (int ii = 0; cname[ii]; ++ii) {
+ if (!isalnum(cname[ii])) {
+ qWarning("QmlMetaType: Invalid QML name %s", cname);
+ return -1;
+ }
+ }
+ }
+
+ QWriteLocker lock(metaTypeDataLock());
+ QmlMetaTypeData *data = metaTypeData();
+
int index = data->types.count();
QmlType *type = new QmlType(id.typeId, id.listId, id.qmlListId,
@@ -468,7 +499,7 @@ int QmlMetaType::registerType(const QmlPrivate::MetaTypeIds &id, QmlPrivate::Fun
data->qmllists.setBit(id.qmlListId, true);
data->lists.setBit(id.listId, true);
- return index;
+ return index; // Note: multi-version call only uses first.
}
int QmlMetaType::qmlParserStatusCast(int userType)
diff --git a/src/declarative/qml/qmlmetatype.h b/src/declarative/qml/qmlmetatype.h
index d83b83e..e023e83 100644
--- a/src/declarative/qml/qmlmetatype.h
+++ b/src/declarative/qml/qmlmetatype.h
@@ -59,7 +59,8 @@ class QmlCustomParser;
class Q_DECLARATIVE_EXPORT QmlMetaType
{
public:
- static int registerType(const QmlPrivate::MetaTypeIds &, QmlPrivate::Func, const char *, const char *, const char *, const QMetaObject *, QmlAttachedPropertiesFunc, const QMetaObject *, int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *);
+ static int registerType(const QmlPrivate::MetaTypeIds &, QmlPrivate::Func, const char *, const char *version, const char *qmlName, const QMetaObject *, QmlAttachedPropertiesFunc, const QMetaObject *, int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *);
+ static int registerType(const QmlPrivate::MetaTypeIds &, QmlPrivate::Func, const char *, int vmaj, int vmin_from, int vmin_to, const char *qmlName, const QMetaObject *, QmlAttachedPropertiesFunc, const QMetaObject *, int pStatus, int object, QmlPrivate::CreateFunc extFunc, const QMetaObject *extmo, QmlCustomParser *);
static int registerInterface(const QmlPrivate::MetaTypeIds &, QmlPrivate::Func, const char *);
static bool copy(int type, void *data, const void *copy = 0);
@@ -173,7 +174,7 @@ int qmlRegisterType(const char *typeName)
}
template<typename T>
-int qmlRegisterType(const char *uri, const char *version, const char *qmlName, const char *typeName)
+int qmlRegisterType(const char *uri, int version_maj, int version_min_from, int version_min_to, const char *qmlName, const char *typeName)
{
QByteArray name(typeName);
QmlPrivate::MetaTypeIds ids = {
@@ -182,7 +183,8 @@ int qmlRegisterType(const char *uri, const char *version, const char *qmlName, c
qRegisterMetaType<T *>(QByteArray("QmlList<" + name + "*>*").constData())
};
- return QmlMetaType::registerType(ids, QmlPrivate::list_op<T>, uri, version, qmlName,
+ return QmlMetaType::registerType(ids, QmlPrivate::list_op<T>,
+ uri, version_maj, version_min_from, version_min_to, qmlName,
&T::staticMetaObject,
QmlPrivate::attachedPropertiesFunc<T>(),
QmlPrivate::attachedPropertiesMetaObject<T>(),
@@ -218,7 +220,7 @@ int qmlRegisterExtendedType(const char *typeName)
}
template<typename T, typename E>
-int qmlRegisterExtendedType(const char *uri, const char *version, const char *qmlName, const char *typeName)
+int qmlRegisterExtendedType(const char *uri, int version_maj, int version_min_from, int version_min_to, const char *qmlName, const char *typeName)
{
QByteArray name(typeName);
QmlPrivate::MetaTypeIds ids = {
@@ -237,7 +239,7 @@ int qmlRegisterExtendedType(const char *uri, const char *version, const char *qm
}
return QmlMetaType::registerType(ids, QmlPrivate::list_op<T>,
- uri, version, qmlName,
+ uri, version_maj, version_min_from, version_min_to, qmlName,
&T::staticMetaObject,
attached, attachedMo,
QmlPrivate::StaticCastSelector<T,QmlParserStatus>::cast(),
@@ -262,7 +264,7 @@ int qmlRegisterInterface(const char *typeName)
}
template<typename T>
-int qmlRegisterCustomType(const char *uri, const char *version, const char *qmlName, const char *typeName, QmlCustomParser *parser)
+int qmlRegisterCustomType(const char *uri, int version_maj, int version_min_from, int version_min_to, const char *qmlName, const char *typeName, QmlCustomParser *parser)
{
QByteArray name(typeName);
QmlPrivate::MetaTypeIds ids = {
@@ -271,7 +273,8 @@ int qmlRegisterCustomType(const char *uri, const char *version, const char *qmlN
qRegisterMetaType<T *>(QByteArray("QmlList<" + name + "*>*").constData())
};
- return QmlMetaType::registerType(ids, QmlPrivate::list_op<T>, uri, version, qmlName,
+ return QmlMetaType::registerType(ids, QmlPrivate::list_op<T>,
+ uri, version_maj, version_min_from, version_min_to, qmlName,
&T::staticMetaObject,
QmlPrivate::attachedPropertiesFunc<T>(),
QmlPrivate::attachedPropertiesMetaObject<T>(),
diff --git a/src/declarative/util/qmlanimation.cpp b/src/declarative/util/qmlanimation.cpp
index 1055387..7c1e242 100644
--- a/src/declarative/util/qmlanimation.cpp
+++ b/src/declarative/util/qmlanimation.cpp
@@ -639,7 +639,7 @@ void QmlAbstractAnimation::timelineComplete()
\l{xmlPauseAnimation} {&lt;PauseAnimation&gt;}.
*/
-QML_DEFINE_TYPE(Qt,4.6,PauseAnimation,QmlPauseAnimation)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PauseAnimation,QmlPauseAnimation)
QmlPauseAnimation::QmlPauseAnimation(QObject *parent)
: QmlAbstractAnimation(*(new QmlPauseAnimationPrivate), parent)
{
@@ -771,7 +771,7 @@ void QmlColorAnimation::setTo(const QColor &t)
QmlPropertyAnimation::setTo(t);
}
-QML_DEFINE_TYPE(Qt,4.6,ColorAnimation,QmlColorAnimation)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ColorAnimation,QmlColorAnimation)
/*!
\qmlclass RunScriptAction QmlRunScriptAction
@@ -865,7 +865,7 @@ QAbstractAnimation *QmlRunScriptAction::qtAnimation()
return d->rsa;
}
-QML_DEFINE_TYPE(Qt,4.6,RunScriptAction,QmlRunScriptAction)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,RunScriptAction,QmlRunScriptAction)
/*!
\qmlclass SetPropertyAction QmlSetPropertyAction
@@ -1073,7 +1073,7 @@ void QmlSetPropertyAction::transition(QmlStateActions &actions,
}
}
-QML_DEFINE_TYPE(Qt,4.6,SetPropertyAction,QmlSetPropertyAction)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SetPropertyAction,QmlSetPropertyAction)
/*!
\qmlclass ParentChangeAction QmlParentChangeAction
@@ -1168,7 +1168,7 @@ void QmlParentChangeAction::transition(QmlStateActions &actions,
}
}
-QML_DEFINE_TYPE(Qt,4.6,ParentChangeAction,QmlParentChangeAction)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParentChangeAction,QmlParentChangeAction)
/*!
\qmlclass NumberAnimation QmlNumberAnimation
@@ -1246,7 +1246,7 @@ void QmlNumberAnimation::setTo(qreal t)
QmlPropertyAnimation::setTo(t);
}
-QML_DEFINE_TYPE(Qt,4.6,NumberAnimation,QmlNumberAnimation)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,NumberAnimation,QmlNumberAnimation)
QmlAnimationGroup::QmlAnimationGroup(QObject *parent)
: QmlAbstractAnimation(*(new QmlAnimationGroupPrivate), parent)
@@ -1336,7 +1336,7 @@ void QmlSequentialAnimation::transition(QmlStateActions &actions,
}
}
-QML_DEFINE_TYPE(Qt,4.6,SequentialAnimation,QmlSequentialAnimation)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,SequentialAnimation,QmlSequentialAnimation)
/*!
\qmlclass ParallelAnimation QmlParallelAnimation
@@ -1418,7 +1418,7 @@ void QmlParallelAnimation::transition(QmlStateActions &actions,
}
}
-QML_DEFINE_TYPE(Qt,4.6,ParallelAnimation,QmlParallelAnimation)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParallelAnimation,QmlParallelAnimation)
//convert a variant from string type to another animatable type
void QmlPropertyAnimationPrivate::convertVariant(QVariant &variant, int type)
@@ -1881,6 +1881,6 @@ void QmlPropertyAnimation::transition(QmlStateActions &actions,
}
}
-QML_DEFINE_TYPE(Qt,4.6,PropertyAnimation,QmlPropertyAnimation)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,PropertyAnimation,QmlPropertyAnimation)
QT_END_NAMESPACE
diff --git a/src/declarative/util/qmlbind.cpp b/src/declarative/util/qmlbind.cpp
index 271be81..2ba8802 100644
--- a/src/declarative/util/qmlbind.cpp
+++ b/src/declarative/util/qmlbind.cpp
@@ -63,7 +63,7 @@ public:
QmlNullableValue<QVariant> value;
};
-QML_DEFINE_TYPE(Qt,4.6,Bind,QmlBind)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Bind,QmlBind)
/*!
\qmlclass Bind QmlBind
\brief The Bind element allows arbitrary property bindings to be created.
diff --git a/src/declarative/util/qmlconnection.cpp b/src/declarative/util/qmlconnection.cpp
index e8879f6..d506782 100644
--- a/src/declarative/util/qmlconnection.cpp
+++ b/src/declarative/util/qmlconnection.cpp
@@ -294,6 +294,6 @@ void QmlConnection::setSignal(const QString& sig)
connectIfValid();
}
-QML_DEFINE_TYPE(Qt,4.6,Connection,QmlConnection)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Connection,QmlConnection)
QT_END_NAMESPACE
diff --git a/src/declarative/util/qmlfollow.cpp b/src/declarative/util/qmlfollow.cpp
index 82e8f0e..d8b520f 100644
--- a/src/declarative/util/qmlfollow.cpp
+++ b/src/declarative/util/qmlfollow.cpp
@@ -48,7 +48,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Follow,QmlFollow)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Follow,QmlFollow)
class QmlFollowPrivate : public QObjectPrivate
{
diff --git a/src/declarative/util/qmlfont.cpp b/src/declarative/util/qmlfont.cpp
index 6e4557f..06e8769 100644
--- a/src/declarative/util/qmlfont.cpp
+++ b/src/declarative/util/qmlfont.cpp
@@ -51,7 +51,7 @@ public:
QFont font;
};
-QML_DEFINE_TYPE(Qt,4.6,Font,QmlFont)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Font,QmlFont)
/*!
\internal
diff --git a/src/declarative/util/qmllistmodel.cpp b/src/declarative/util/qmllistmodel.cpp
index aa6cc2c..718040e 100644
--- a/src/declarative/util/qmllistmodel.cpp
+++ b/src/declarative/util/qmllistmodel.cpp
@@ -500,14 +500,14 @@ void QmlListModelParser::setCustomData(QObject *obj, const QByteArray &d)
}
}
-QML_DEFINE_CUSTOM_TYPE(Qt, 4.6, ListModel, QmlListModel, QmlListModelParser)
+QML_DEFINE_CUSTOM_TYPE(Qt, 4,6, (QT_VERSION&0x00ff00)>>8, ListModel, QmlListModel, QmlListModelParser)
// ### FIXME
class QmlListElement : public QObject
{
Q_OBJECT
};
-QML_DEFINE_TYPE(Qt,4.6,ListElement,QmlListElement)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ListElement,QmlListElement)
static void dump(ModelNode *node, int ind)
{
diff --git a/src/declarative/util/qmlpackage.cpp b/src/declarative/util/qmlpackage.cpp
index d4bf0f9..8483080 100644
--- a/src/declarative/util/qmlpackage.cpp
+++ b/src/declarative/util/qmlpackage.cpp
@@ -147,7 +147,7 @@ QmlPackageAttached *QmlPackage::qmlAttachedProperties(QObject *o)
return new QmlPackageAttached(o);
}
-QML_DEFINE_TYPE(Qt,4.6,Package,QmlPackage)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Package,QmlPackage)
QT_END_NAMESPACE
diff --git a/src/declarative/util/qmlpalette.cpp b/src/declarative/util/qmlpalette.cpp
index 507568d..01b5ad3 100644
--- a/src/declarative/util/qmlpalette.cpp
+++ b/src/declarative/util/qmlpalette.cpp
@@ -52,7 +52,7 @@ public:
QPalette::ColorGroup group;
};
-QML_DEFINE_TYPE(Qt,4.6,Palette,QmlPalette)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Palette,QmlPalette)
/*!
\internal
diff --git a/src/declarative/util/qmlscript.cpp b/src/declarative/util/qmlscript.cpp
index 5aa87d7..cfe5a1e 100644
--- a/src/declarative/util/qmlscript.cpp
+++ b/src/declarative/util/qmlscript.cpp
@@ -99,7 +99,7 @@ public:
avoided.
*/
-QML_DEFINE_TYPE(Qt,4.6,Script,QmlScript)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Script,QmlScript)
QmlScript::QmlScript(QObject *parent) : QObject(*(new QmlScriptPrivate), parent)
{
}
diff --git a/src/declarative/util/qmlsetproperties.cpp b/src/declarative/util/qmlsetproperties.cpp
index b067fcf..bbbc6a9 100644
--- a/src/declarative/util/qmlsetproperties.cpp
+++ b/src/declarative/util/qmlsetproperties.cpp
@@ -357,6 +357,6 @@ void QmlSetProperties::setIsExplicit(bool e)
d->isExplicit = e;
}
-QML_DEFINE_CUSTOM_TYPE(Qt, 4.6, SetProperties, QmlSetProperties, QmlSetPropertiesParser)
+QML_DEFINE_CUSTOM_TYPE(Qt, 4,6, (QT_VERSION&0x00ff00)>>8, SetProperties, QmlSetProperties, QmlSetPropertiesParser)
QT_END_NAMESPACE
diff --git a/src/declarative/util/qmlstate.cpp b/src/declarative/util/qmlstate.cpp
index 351325f..3cd72b1 100644
--- a/src/declarative/util/qmlstate.cpp
+++ b/src/declarative/util/qmlstate.cpp
@@ -126,7 +126,7 @@ QmlStateOperation::QmlStateOperation(QObjectPrivate &dd, QObject *parent)
\sa {states-transitions}{States and Transitions}
*/
-QML_DEFINE_TYPE(Qt,4.6,State,QmlState)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,State,QmlState)
QmlState::QmlState(QObject *parent)
: QObject(*(new QmlStatePrivate), parent)
{
diff --git a/src/declarative/util/qmlstategroup.cpp b/src/declarative/util/qmlstategroup.cpp
index 8977642..13a0023 100644
--- a/src/declarative/util/qmlstategroup.cpp
+++ b/src/declarative/util/qmlstategroup.cpp
@@ -49,7 +49,7 @@ QT_BEGIN_NAMESPACE
DEFINE_BOOL_CONFIG_OPTION(stateChangeDebug, STATECHANGE_DEBUG);
-QML_DEFINE_TYPE(Qt,4.6,StateGroup,QmlStateGroup)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,StateGroup,QmlStateGroup)
class QmlStateGroupPrivate : public QObjectPrivate
{
diff --git a/src/declarative/util/qmlstateoperations.cpp b/src/declarative/util/qmlstateoperations.cpp
index 4b1b63f..2a051bd 100644
--- a/src/declarative/util/qmlstateoperations.cpp
+++ b/src/declarative/util/qmlstateoperations.cpp
@@ -122,7 +122,7 @@ void QmlParentChangePrivate::doChange(QFxItem *targetParent)
\brief The ParentChange element allows you to reparent an object in a state.
*/
-QML_DEFINE_TYPE(Qt,4.6,ParentChange,QmlParentChange)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,ParentChange,QmlParentChange)
QmlParentChange::QmlParentChange(QObject *parent)
: QmlStateOperation(*(new QmlParentChangePrivate), parent)
{
@@ -209,7 +209,7 @@ public:
\qmlclass RunScript QmlRunScript
\brief The RunScript element allows you to run a script in a state.
*/
-QML_DEFINE_TYPE(Qt,4.6,RunScript,QmlRunScript)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,RunScript,QmlRunScript)
QmlRunScript::QmlRunScript(QObject *parent)
: QmlStateOperation(*(new QmlRunScriptPrivate), parent)
{
diff --git a/src/declarative/util/qmltimer.cpp b/src/declarative/util/qmltimer.cpp
index caf316a..456b2ef 100644
--- a/src/declarative/util/qmltimer.cpp
+++ b/src/declarative/util/qmltimer.cpp
@@ -47,7 +47,7 @@
QT_BEGIN_NAMESPACE
-QML_DEFINE_TYPE(Qt,4.6,Timer,QmlTimer)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Timer,QmlTimer)
class QmlTimerPrivate : public QObjectPrivate
{
diff --git a/src/declarative/util/qmltransition.cpp b/src/declarative/util/qmltransition.cpp
index 431059f..eb8bf53 100644
--- a/src/declarative/util/qmltransition.cpp
+++ b/src/declarative/util/qmltransition.cpp
@@ -135,7 +135,7 @@ void ParallelAnimationWrapper::updateState(QAbstractAnimation::State oldState, Q
}
-QML_DEFINE_TYPE(Qt,4.6,Transition,QmlTransition)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,Transition,QmlTransition)
QmlTransition::QmlTransition(QObject *parent)
: QObject(*(new QmlTransitionPrivate), parent)
{
diff --git a/src/declarative/widgets/graphicslayouts.cpp b/src/declarative/widgets/graphicslayouts.cpp
index 217ecf7..35f1e35 100644
--- a/src/declarative/widgets/graphicslayouts.cpp
+++ b/src/declarative/widgets/graphicslayouts.cpp
@@ -89,7 +89,7 @@ private:
Qt::Alignment _alignment;
};
-QML_DEFINE_TYPE(Qt,4.6,QGraphicsLinearLayoutStretchItem,QGraphicsLinearLayoutStretchItemObject)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QGraphicsLinearLayoutStretchItem,QGraphicsLinearLayoutStretchItemObject)
QGraphicsLinearLayoutStretchItemObject::QGraphicsLinearLayoutStretchItemObject(QObject *parent)
: QObject(parent)
@@ -103,7 +103,7 @@ QSizeF QGraphicsLinearLayoutStretchItemObject::sizeHint(Qt::SizeHint which, cons
return QSizeF();
}
-QML_DEFINE_TYPE(Qt,4.6,QGraphicsLinearLayout,QGraphicsLinearLayoutObject)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QGraphicsLinearLayout,QGraphicsLinearLayoutObject)
QGraphicsLinearLayoutObject::QGraphicsLinearLayoutObject(QObject *parent)
: QObject(parent), _children(this)
@@ -246,7 +246,7 @@ private:
Qt::Alignment _alignment;
};
-QML_DEFINE_TYPE(Qt,4.6,QGraphicsGridLayout,QGraphicsGridLayoutObject)
+QML_DEFINE_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QGraphicsGridLayout,QGraphicsGridLayoutObject)
QGraphicsGridLayoutObject::QGraphicsGridLayoutObject(QObject *parent)
diff --git a/src/declarative/widgets/graphicswidgets.cpp b/src/declarative/widgets/graphicswidgets.cpp
index 782ffba..4c6dcf9 100644
--- a/src/declarative/widgets/graphicswidgets.cpp
+++ b/src/declarative/widgets/graphicswidgets.cpp
@@ -59,7 +59,7 @@ public:
static_cast<QGraphicsView *>(parent())->setScene(scene);
}
};
-QML_DEFINE_EXTENDED_TYPE(Qt,4.6,QGraphicsView,QGraphicsView,QGraphicsViewDeclarativeUI)
+QML_DEFINE_EXTENDED_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QGraphicsView,QGraphicsView,QGraphicsViewDeclarativeUI)
class QGraphicsSceneDeclarativeUI : public QObject
{
@@ -111,7 +111,7 @@ private:
};
Children _children;
};
-QML_DEFINE_EXTENDED_TYPE(Qt,4.6,QGraphicsScene,QGraphicsScene,QGraphicsSceneDeclarativeUI)
+QML_DEFINE_EXTENDED_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QGraphicsScene,QGraphicsScene,QGraphicsSceneDeclarativeUI)
class QGraphicsWidgetDeclarativeUI : public QObject
{
@@ -164,7 +164,7 @@ private:
QmlConcreteList<QObject *> _data;
};
-QML_DEFINE_EXTENDED_TYPE(Qt,4.6,QGraphicsWidget,QGraphicsWidget,QGraphicsWidgetDeclarativeUI)
+QML_DEFINE_EXTENDED_TYPE(Qt,4,6,(QT_VERSION&0x00ff00)>>8,QGraphicsWidget,QGraphicsWidget,QGraphicsWidgetDeclarativeUI)
QML_DEFINE_INTERFACE(QGraphicsItem)