[Development] QtQml value types

Roland Winklmeier roland.m.winklmeier at gmail.com
Thu Apr 24 11:55:07 CEST 2014


Hi list,

we discussed the topic whether non-QObject types can be used in QML or not
several times. The last time is only a few days ago as part of the Qt
future discussions. So I had some thoughts what needs to happen to solve
this issue.

I can remember someone told me there are plans to add such a feature. So my
first question is, how far are we on this? Is it just a plan or is someone
really working on it already? Are there any details?

If there is nothing happening at the moment, I'd like to share some ideas I
had during the last days.
I'm not an expert in QtQuick/QML internals so I have no idea what might be
possible or not. At the moment I assume only QObject derived classes can be
used in QML contexts.

Charley's presentation (
http://www.qtdeveloperdays.com/sites/default/files/presentation_pdf/QtDevDaysSFO-2013_WrappingCppForQml_final.pdf)
was very interesting to me as I see this as a possible workaround until
something more sophisticated is in place.
During discussions in our team one of the members pointed me to internal
class QQmlValueType (
https://qt.gitorious.org/qt/qtdeclarative/source/HEAD:src/qml/qml/qqmlvaluetype_p.h).
This is used to make Qt value types like QSize, QPointF available through a
QObject wrapper and is very similar to what charley presented.
Now I wonder can't we just make this (or something similar) available as a
public API? This would allow developers to add their custom types without
much effort and would solve a lot problems.
I don't think this is much effort but it will help a lot.

Thoughts?

Roland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20140424/65ef69aa/attachment.html>


More information about the Development mailing list