Review Request: Fix KWidgetItemeDelegate to correctly update widget positions when a row gets removed

Thomas Richard thomas.richard at
Tue Jan 25 09:30:58 GMT 2011

This is an automatically generated e-mail. To reply, visit:

(Updated Jan. 25, 2011, 9:30 a.m.)

Review request for kdelibs, Kevin Ottens and Rafael Fernández López.


Removed the whitespace


When a row other then the last got removed from a model, the widgets that are created by the itemdelegate are not moved. This is obviously a big problem when you start removing rows in between. The wrong widgets will show up in the wrong rows. This also happens when you insert a new row instead of appending it.

This patch will update the widgets position of the rows that come behind the one that is inserted/removed. I also had to change QModelIndex to QPersistentModelIndex at one place because the modelindex changes when your remove/insert a row in the middle and new widgets would get created.

Diffs (updated)

  trunk/KDE/kdelibs/kdeui/itemviews/kwidgetitemdelegate.h 1216172 
  trunk/KDE/kdelibs/kdeui/itemviews/kwidgetitemdelegate.cpp 1216172 
  trunk/KDE/kdelibs/kdeui/itemviews/kwidgetitemdelegate_p.h 1216172 
  trunk/KDE/kdelibs/kdeui/itemviews/kwidgetitemdelegatepool_p.h 1216172 



*Insert a row at the start/in the middle/at the end
*Remove a row at the start/in the middle/at the end

Everything seems to work now.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the kde-core-devel mailing list