Hello Qt community,
I’ve been searching and testing some new QML functionalities and I am in doubt.
What I would like to do is to get the information of an object in QML to a class in C++.
Right now I’ve beel able to extend the QML functionality by creating a class that inherits from QDeclarativeView, and in this class I have some data members and its respective Q_PROPERTY getters and setters to be used in the QML.
So lets say in my QML I have something like this:
myClassExtensionObject{
name: “QML Object name goes here”
}
And as my C++ class I have something like:
@class myClassExtensionObject{
Q_PROPERTIES( name READ getterFunction WRITE setterFunction )
void setterFunction() const;
Qstring getterFucntion();
private:
QString name;
}@…. and so on.
So this works perfeclty….as I understand, and object instance of myClassExtensionObject is created in the QML…. but what I would like to do is to get this QML object (instance) and use its information in some other class in C++ to process and freely handle this information from the QML.
I am not sure how to achieve such a thing, and hopefully I am explaining myself correctly.
Thanks in advace Qt Community.
Regards
↧