[Qt-interest] ***SPAM*** QAbstractItemModel edit process

Ramesh ramesh.bs at robosoftin.com
Thu Apr 22 06:15:48 CEST 2010


I think you can  try implementing the delegate method for your list view,

And handle the update operation there of your wish

 

From: qt-interest-bounces at trolltech.com
[mailto:qt-interest-bounces at trolltech.com] On Behalf Of Nikos Gerontidis
Sent: Wednesday, April 21, 2010 6:59 PM
To: qt-interest at trolltech.com
Subject: ***SPAM*** [Qt-interest] QAbstractItemModel edit process

 

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


-----------------------------------------------
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an intended recipient, please notify the sender and delete all copies. Emails to and from our network may be logged and monitored. This email and its attachments are scanned for virus by our scanners and are believed to be safe. However, no warranty is given that this email is free of malicious content or virus.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100422/e98a5523/attachment.html 


More information about the Qt-interest-old mailing list