[PyKDE] [PyQt]: how to refresh a QTreeView widget?

Andreas Pakulat apaku at gmx.de
Thu Sep 7 16:21:35 BST 2006


On 07.09.06 16:44:23, Oscar Cossu wrote:
> Hy all,  I set the model of a QTreeView with an object that is a subclass of
> QAbstractItemModel.
> When I change the model (ex. deleting a row) and emit layoutChanged()
> signal, the treeModel should update the view, but errors occur.

Read the Qt documentation on model/view again. You shouldn't use
layoutChanged() but call QAbstractItemModel::beginRemoveRows() and
::endRemoveRows (the same for inserting rows).

Andreas

-- 
Accent on helpful side of your nature.  Drain the moat.




More information about the PyQt mailing list