diff options
Diffstat (limited to 'src/qml/types/qqmllistmodel_p_p.h')
-rw-r--r-- | src/qml/types/qqmllistmodel_p_p.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/qml/types/qqmllistmodel_p_p.h b/src/qml/types/qqmllistmodel_p_p.h index 10916f10db..ee23f8f064 100644 --- a/src/qml/types/qqmllistmodel_p_p.h +++ b/src/qml/types/qqmllistmodel_p_p.h @@ -164,15 +164,17 @@ namespace QV4 { namespace Heap { struct ModelObject : public QObjectWrapper { - void init(QObject *object, QQmlListModel *model, int elementIndex) + void init(QObject *object, QQmlListModel *model) { QObjectWrapper::init(object); m_model = model; - m_elementIndex = elementIndex; + QObjectPrivate *op = QObjectPrivate::get(object); + m_nodeModelMetaObject = static_cast<ModelNodeMetaObject *>(op->metaObject); } void destroy() { QObjectWrapper::destroy(); } + int elementIndex() const { return m_nodeModelMetaObject->m_elementIndex; } QQmlListModel *m_model; - int m_elementIndex; + ModelNodeMetaObject *m_nodeModelMetaObject; }; } |