[Interest] Can I access dynamic properties defined in C++ into QML ?

Gian Maxera gmaxera at gmail.com
Fri Mar 11 16:46:30 CET 2016


Hello,
If I set a dynamic properties from C++:
void CloudModel::setPropertiesFromJson( QJsonObject json ) {
	foreach( QString key, json.keys() ) {
		QJsonValue value = json[key];
		setProperty( key.toLatin1(), value.toVariant() );

then, I cannot access any of these new properties from QML side even if CloudModel has been exposed to QML with qmlDeclareType.

Is this an intended behaviour or Am I doing something wrong ?

Thanks,
Gianluca.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20160311/0de09345/attachment.html>


More information about the Interest mailing list