AFAIK QML is perfect for writing small, preferably mobile applications, fitting perfectly for high-performance touch apps on mobile devices. Since Qt 5(.1) it is possible to write desktop applications as well. But being a declarative language, QML easyly only supports fixed UIs, to some extent. Of course, you can compare a QML file to an .ui file of the QtWidget system - an .ui file is also kind of "declarative" and can be loaded dynamically by Qt into the app - or "compiled" into C++ by uic.
Writing an UI programmatically, allows you to make it dynamic, not only in the sense of "if this checkbox is toggled, then hide/show that element" - this could be done in QML in the same way or easier. What I mean is, designing big programs with granular modules (plugins) that extend each other. How can I use QML for e.g., having a basic interface that has kind of "ExtensionPoints" for other QML widgets in a structured way?
Best example would be the main screen. A QML MainWindow with some basic menu/toolbar/statusbar widgets would be defined as the core program, and each plugin defines it's own widgets:
- Menu Items
- Containers, List- and other -views
- Toolbuttons
- StatusBar widgets
- etc
The only thing I could think of is the dynamically creation of QML objects, as described in http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-interactqmlfromcpp.html - but this seems very cumbersome to me - how would you do this? How can I use parts of the codebase for a mobile app? Of course the C++ part - but if that one is pluggable/the plugin framework, like in QtCreator itself, it is only possible to use the basic utilities and libraries (the real backend, e.g. database layers) for a mobile app as well? Or can I use parts of QML and the plugin "glue" code too? Is this generally possible, or desireable? Or better write complete separated code for desktop/mobile for the plugin framework/QML part and just reuse the basic (e.g. database) layers?
Basically (shorted) question is: How do I generally design an application, written in QML/C++, or QML/Python(3)/PyQt5, that has a pluggable UI, and additionally share codebase with a mobile app?
I don't expect you to do the whole bunch of work for me (and I have done much thinking myself on this, as far as I could get), just give me a few hints, how to start here as best approach. Thanks in advance.