I have QAbstractListModel in c++ code and connected it with qml GridView of Butons by means of
QQmlApplicationEngine engine;
QQmlContext* context = engine.rootContext();
context->setContextProperty("keyboardModel", _keyboardModel);
The main goal is get global coordinates of Buttons in c++ code. For this purposes i find this Buttons with QQuickItem::childItems()
function and get final coordinates with mapToGlobal()
.
Now, when i changed c++ model, qml GridView changed too. But, i cannot catch moment, when hierarchical QQuickItem tree fully refreshed (It needed for correct working QQuickItem::childItems()
)
GridView's signals onAdd, on Remove doesn't working, when new model has same amount of elements. GridView's signal onModelChanged triggered only, when i connected another model, not when i changed this one.
Is there any signal for recognizing, when hierarchical QQuickItem tree fully refreshed? Or there is any another method for dynamically getting Qml's object global coordinates?