vineeth
2011-05-24 11:17:58 UTC
Hello,
I am using a C++ QAbstractItemModel as a model for a ListView and have
implemented the setData
<http://doc.trolltech.com/4.7.1/qabstractitemmodel.html#setData>and
items<http://doc.trolltech.com/4.7.1/qabstractitemmodel.html#flags>as
indicated in the documentation to make the items editable.
However, if I call, model.setProperty( ... ) from the delegate I get
TypeError:
Result of expression 'model.setProperty' [undefined] is not a function.
I get the same error, even for model.setData(...) call.
calling model.<rolename> = <new role value> from delegate throws
read-only error.
What is the right procedure to set a role value of a abstract item model
from a QML delegate?
Has anybody experienced this error and pls let me know your inputs in
solving it.
( I have reproduced this error in the AnimalModel
example<http://doc.trolltech.com/4.7.1/declarative-modelviews-abstractitemmodel.html>,
and attached the Qt Pro.)
Kindly share your insights.
Thanks.
--vineeth
I am using a C++ QAbstractItemModel as a model for a ListView and have
implemented the setData
<http://doc.trolltech.com/4.7.1/qabstractitemmodel.html#setData>and
items<http://doc.trolltech.com/4.7.1/qabstractitemmodel.html#flags>as
indicated in the documentation to make the items editable.
However, if I call, model.setProperty( ... ) from the delegate I get
TypeError:
Result of expression 'model.setProperty' [undefined] is not a function.
I get the same error, even for model.setData(...) call.
calling model.<rolename> = <new role value> from delegate throws
read-only error.
What is the right procedure to set a role value of a abstract item model
from a QML delegate?
Has anybody experienced this error and pls let me know your inputs in
solving it.
( I have reproduced this error in the AnimalModel
example<http://doc.trolltech.com/4.7.1/declarative-modelviews-abstractitemmodel.html>,
and attached the Qt Pro.)
Kindly share your insights.
Thanks.
--vineeth