How to create C++ objects dynamically and bind with QML UI
Hi, I'm a relative beginner with Qt Creator, and have some experience with C++ but I'm new to QML.
I've been going through the following Dynamic Scene Example:
http://qt-project.org/doc/qt-4.8/dec...amicscene.html
I follow how the objects are created dynamically using QML. I want to know is it possible to create
similar objects dynamically using C++ funtions in Qt Creator, as I cant seem to find any examples
of this.
My goal is to extend QML using C++.
ie. C++ functions -> QML properties.
Thank you.
Re: How to create C++ objects dynamically and bind with QML UI
What do you mean by "similar objects"?
Re: How to create C++ objects dynamically and bind with QML UI
I basically mean any generic object that can be open, closed, attached etc. that is created using C++. I'm looking for examples to learn from, and have already found some that creates the objects using QML, such as the Dynamic scene example.
Thanks.
Re: How to create C++ objects dynamically and bind with QML UI
The dynamic scene example doesn't create any objects in C++. If you want to create qml items in C++ then you can of course do that however I don't understand why you'd want to do that really. Usually we do expose some objects from C++ to the declarative engine however they are usually not qml items or are at least created from QML code using QDeclarativeComponent or similar.