diff options
author | Aaron Kennedy <aaron.kennedy@nokia.com> | 2012-05-11 12:01:41 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-24 12:52:43 +0200 |
commit | d2e557c2c2d7fcf3bf7c1676df3902e115986dc2 (patch) | |
tree | 65f47e443efa9635a2634880c01dc439817f9566 /src/quick/items/qquickvisualadaptormodel.cpp | |
parent | 0a3ff88f851771e52d119fab90c0254de6950585 (diff) |
Lazily create QMetaObjects
For internal QML built types, creating a metaobject each time is
just wasteful. Additionally, as the property caches were always
created from the intermediate QMetaObject, it was difficult to pass
information directly from the compiler to the property cache.
Change-Id: I769526b0edaaf16a86883f3065b75618b94e4077
Reviewed-by: Roberto Raggi <roberto.raggi@nokia.com>
Diffstat (limited to 'src/quick/items/qquickvisualadaptormodel.cpp')
-rw-r--r-- | src/quick/items/qquickvisualadaptormodel.cpp | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/quick/items/qquickvisualadaptormodel.cpp b/src/quick/items/qquickvisualadaptormodel.cpp index d772d67c18..99c44e329c 100644 --- a/src/quick/items/qquickvisualadaptormodel.cpp +++ b/src/quick/items/qquickvisualadaptormodel.cpp @@ -996,29 +996,29 @@ void QQuickVisualAdaptorModel::setModel(const QVariant &variant, QQuickVisualDat if (QAbstractItemModel *model = qobject_cast<QAbstractItemModel *>(object)) { accessors = new VDMAbstractItemModelDataType(this); - FAST_CONNECT(model, SIGNAL(rowsInserted(QModelIndex,int,int)), - vdm, SLOT(_q_rowsInserted(QModelIndex,int,int))); - FAST_CONNECT(model, SIGNAL(rowsRemoved(QModelIndex,int,int)), - vdm, SLOT(_q_rowsRemoved(QModelIndex,int,int))); - FAST_CONNECT(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), - vdm, SLOT(_q_dataChanged(QModelIndex,QModelIndex))); - FAST_CONNECT(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), - vdm, SLOT(_q_rowsMoved(QModelIndex,int,int,QModelIndex,int))); - FAST_CONNECT(model, SIGNAL(modelReset()), - vdm, SLOT(_q_modelReset())); - FAST_CONNECT(model, SIGNAL(layoutChanged()), - vdm, SLOT(_q_layoutChanged())); + qmlobject_connect(model, QAbstractItemModel, SIGNAL(rowsInserted(QModelIndex,int,int)), + vdm, QQuickVisualDataModel, SLOT(_q_rowsInserted(QModelIndex,int,int))); + qmlobject_connect(model, QAbstractItemModel, SIGNAL(rowsRemoved(QModelIndex,int,int)), + vdm, QQuickVisualDataModel, SLOT(_q_rowsRemoved(QModelIndex,int,int))); + qmlobject_connect(model, QAbstractItemModel, SIGNAL(dataChanged(QModelIndex,QModelIndex)), + vdm, QQuickVisualDataModel, SLOT(_q_dataChanged(QModelIndex,QModelIndex))); + qmlobject_connect(model, QAbstractItemModel, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)), + vdm, QQuickVisualDataModel, SLOT(_q_rowsMoved(QModelIndex,int,int,QModelIndex,int))); + qmlobject_connect(model, QAbstractItemModel, SIGNAL(modelReset()), + vdm, QQuickVisualDataModel, SLOT(_q_modelReset())); + qmlobject_connect(model, QAbstractItemModel, SIGNAL(layoutChanged()), + vdm, QQuickVisualDataModel, SLOT(_q_layoutChanged())); } else if (QListModelInterface *model = qobject_cast<QListModelInterface *>(object)) { accessors = new VDMListModelInterfaceDataType(this); - FAST_CONNECT(model, SIGNAL(itemsChanged(int,int,QList<int>)), - vdm, SLOT(_q_itemsChanged(int,int,QList<int>))); - FAST_CONNECT(model, SIGNAL(itemsInserted(int,int)), - vdm, SLOT(_q_itemsInserted(int,int))); - FAST_CONNECT(model, SIGNAL(itemsRemoved(int,int)), - vdm, SLOT(_q_itemsRemoved(int,int))); - FAST_CONNECT(model, SIGNAL(itemsMoved(int,int,int)), - vdm, SLOT(_q_itemsMoved(int,int,int))); + qmlobject_connect(model, QListModelInterface, SIGNAL(itemsChanged(int,int,QList<int>)), + vdm, QQuickVisualDataModel, SLOT(_q_itemsChanged(int,int,QList<int>))); + qmlobject_connect(model, QListModelInterface, SIGNAL(itemsInserted(int,int)), + vdm, QQuickVisualDataModel, SLOT(_q_itemsInserted(int,int))); + qmlobject_connect(model, QListModelInterface, SIGNAL(itemsRemoved(int,int)), + vdm, QQuickVisualDataModel, SLOT(_q_itemsRemoved(int,int))); + qmlobject_connect(model, QListModelInterface, SIGNAL(itemsMoved(int,int,int)), + vdm, QQuickVisualDataModel, SLOT(_q_itemsMoved(int,int,int))); } else { accessors = new VDMObjectDelegateDataType; } |