[Qt5-feedback] C++ api to use for UI in addition to QML
Richard Moore
rich at kde.org
Tue May 17 22:05:38 CEST 2011
On Tue, May 17, 2011 at 2:00 AM, Alan Alpert <alan.alpert at nokia.com> wrote:
> You can't find an item by id from C++, it's a detail internal to the QML
> engine. ObjectName will continue to work in Qt 5 though.
For some reason, you seem to be under the impression that using
findChild in order to interact is a good API. Please could you explain
this? It's very clear that many users would like to make use of parts
of QML (for example basic widgets) but don't want to move to QML
completely - this makes complete sense, since QML seems to be targeted
at small, flashy UIs. Surely it is obvious that a better way of
interacting with QML from C++ is a basic requirement for adoption in
non-trivial applications?
>
> In fact, QML 2.0 should have a very similar C++ API to QML1.x (because we
> expose so little of it). You will be able to instantiate QML scenes with
> components, and use the meta object system for introspection. It would help if
> you provide more detail than 'interact with'. What's missing from the QML 1.x
> C++ support that you want (keeping Thiago's points in mind, as he is entirely
> correct) ?
I'd like to be able to write code using the QML based widgets in a
similar way to the way I can currently do so with QWidgets. ie. Use a
pre-built component set from C++ by instantiating and interacting
directly with the widgets.
I'm not anti-javascript - I wrote the KDE javascript binding, but this
is seeming like you plan to port the flaws of the current design to
the new code base.
>
> Another thing to keep in mind is that you won't have to write Javascript to
> use QML. Qt Creator has a QML design view that you can use, and then
> everything gets hooked up like it used to be with .ui files. Except with
> greater customization and more animations. With Qt 5, you will be able to
> create UIs without 'writing' QML, just by using the tools.
I can do that with flash. I'm hoping for something more.
Rich.
More information about the Qt5-feedback
mailing list