PDA

View Full Version : [delegate] wrong commit for boolean



lauranger
25th October 2006, 17:48
Hi
Has anybody used the default delegate (QItemDelegate)
on a default model (QStandardItemModel) with a boolean column ?
For display things are OK at first : "true" or "false"
edition start quite well, too : a combobox with "false" and "true" appears,
then when committing the change, an int value is poured into the model
in stead of a boolean, it seems.
Has anybody faced such a behaviour ? What can I have missed ?
Thx in advance.

Laurent G.

e8johan
25th October 2006, 17:52
All the values of a model are QVariants, so it does not really matter if an int or something else is fed into the model as long as it converts properly into a boolean.

jpn
25th October 2006, 18:42
Task Tracker: 125584 (http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=125584)- QItemDelegate::setModelData() does not handle boolean values

lauranger
26th October 2006, 08:14
Thanks jpn.