On 12/12/2013 02:39 PM, Robin Burchell wrote:
On 12 Dec 2013, at 14:28, Wim de Vries <wsvr...@xs4all.nl
<mailto:wsvr...@xs4all.nl>> wrote:
I need to set many properties in QML elements from within C++.
You may find it easier to expose these properties *from* C++ to QML,
using a singleton type (for example)
http://qt-project.org/doc/qt-5.0/qtqml/qtqml-cppintegration-definetypes.html#registering-singleton-objects-with-a-singleton-type
Yes, I have to control many property values.
I'm not sure how that matters.. see:
http://qt-project.org/doc/qt-5.0/qtqml/qqmlengine.html#qmlRegisterSingletonType-2
You can register your object instance as a singleton, exposing as many
properties/methods as you like - there's no limitations and it's
fairly easily done
Theme properties in Silica are exposed through a singleton, for example.
Why is the Qt preferred way deprecated in Sailfish?
QQmlProperty <http://qt-project.org/doc/qt-5.0/qtqml/qqmlproperty.html>::write(object,
"someNumber", 5000)
So much simpler and understandable.
_______________________________________________
SailfishOS.org Devel mailing list
_______________________________________________
SailfishOS.org Devel mailing list