[Qt-interest] QAbstractItemModel edit process

Nikos Gerontidis geronik444 at gmail.com
Wed Apr 21 15:28:42 CEST 2010


Hello list,

I have subclassed the QAbstractItemModel class and reimplemented the setData
and the other functions needed in order to make the model editable.
I have created custom items and my model follows a tree structure and
multiple columns.
The problem is that when I edit my model for a given index for decoration
prurposes, then this results to setting all columns with decoration flags
enabled to
be updated with the data given. To be more specific, I made an example post
:
*setData(model->index(1,4),QColor(Qt::blue),Qt::DecorationRole)*
after updating this then also the data of model->*index(1,6)* are being
updated.
The above situation is not happening though when my model is being updated
for the last column :
*setData(model->**index(1,6)**,QColor(Qt::blue),Qt::DecorationRole)*
*this does not result *to an update of *model->**index(1,4)*

Does the model updates all remaining indexes until model->columnCount() ;
If yes how could I end this update in order to set my data correctly? Any
ideas?
Thanks in advance..

-- 
Best Regards
Nikos Gerontidis
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100421/9e083c30/attachment.html 


More information about the Qt-interest-old mailing list