How to make desktop app with logic in C++ and gui in Qt Quick/QML?
-
Hello,
in next week I want to familiar with Qt 5. Currently I'm working on Qt 4.7 and I don't use Qt Quick. I think about to try make application for desktop which logic will be written in C++ and gui would be in Qt Quick/QML. What topics from doc I should read? I found this:
"Integrating QML and C++":http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-topic.html
This will be good to start about embedding QML in C++? What else are you suggest to read?I will be grateful for your help.
Best regards. -
May I sugget http://doc.qt.digia.com/qt/qtbinding.html
-
Thanks Fahmy.
Maybe somebody know about example application or open source project where C++ Qt uses QML as gui?
-
Are you asking about extending QML using C++ or abstracting logic from UI?
Signals and slots, properties, Q_INVOCABLE is pretty much all you need to "glue" C++ logic and put that inside of a QML UI. You can then easily implement different UIs, either with QtWidget or QML, using the same logic.
If you want to display data in QML, you might also have to build data models in C++.
And lastly - the concept of extending QML, which isn't really a matter of abstracting logic from UI, but may also be used in that context.