Quantcast
Channel: Qt DevNet forums: Qt Quick 1283365070**
Viewing all articles
Browse latest Browse all 4972

How to add dynamically created QQuickItem to VisualItemModel?

$
0
0
Here’s the code:         QQuickItem *miniWindowParent = aMainWindow.rootGui()->rootObject()->findChild<QQuickItem*>("samplersMiniListModel");           Q_ASSERT(miniWindowParent != 0);           mDummyMiniItem->setParentItem(miniWindowParent); samplersMiniListModel is VisualItemModel in QML. And this not works (program crashes on the Q_ASSERT). Reason is that the VisualItemModel isnt QQuickItem*. —————————————————————————————— This code works good:         QObject *miniWindowParent = aMainWindow.rootGui()->rootObject()->findChild<QObject*>("samplersMiniListModel");           Q_ASSERT(miniWindowParent != 0);           mDummyMiniItem->setParent(miniWindowParent); but has no effect (Window dont adds to List). Anyone know how to add QQuickItem* to VisualItemModel ?

Viewing all articles
Browse latest Browse all 4972

Trending Articles