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 ?
↧