Accessing QML array from c++
Hi,
I have created an array in javascript in QML and filled it using javascript. This array contains QML objects.
I need to access and update this array using c++ in my main QT function.
I have searched alot but most of results talk about solution for accessing cpp objects defined in QML.
What I need is vice versa.
Would you please help?
Re: Accessing QML array from c++
You need to locate a child object and then you will be able to modify a list.
Re: Accessing QML array from c++
Thanks for your reply Spirit.
But what I am looking for, is to access a java script array in QT main function using c++.
I have defined following arrays in my QML.js
.pragma library
var dObjects1 = [];
var dObjects2 = [];
I need to access dObjects1 and dObjects2 in the main QT function.
Re: Accessing QML array from c++
It's not possibly. You should attach these object to QML objects properties.