Okay so I understand you can connect signals and slots between QML and C++ objects and how to pass stuff generated in C++ to QML but how would I go about calling property of QML object for use in C++. Basically what I am trying to do is take text input from the TextInput component in QML and use it to set the currentPath() of an object which in the QDir class. I am sure I messed up a lot syntax and stuff there but I am pretty new to this.
I was thinking of doing something like
QObject *object = view.rootObject();
QObject textIn = object->findChild<QObject>("textIn");
and then calling text property like so and using QString to make a string.
and then doing the following to set my QDir path
But this doesn't work as I get following error
request for member ‘text’ in ‘textIn’, which is of non-class type ‘QObject*’
Anyone know the proper way to go about retrieving properties of QML objects for use in C++?
I would also be okay with being able to set the a variable in QML equal to some variable and then being able to call that in C++.
I would also be okay with being told I am asking a stupid question and what I am talking about is impossible or there is a better way to do such a thing any help would be great.
Edit: use @ tags to markup code sections please; Andre