[PyKDE] QtGui.QItemSelectionModel.NoUpdate problem

Andreas Pakulat apaku at gmx.de
Sat Oct 14 12:12:55 BST 2006


On 14.10.06 10:32:46, Dave S wrote:
> I have a Qtabelwidget and want it so that when someone clicks on an cell no 
> selection is made. Looking around ...
> 
> self.tableWidget.setSelectionModel(QtGui.QItemSelectionModel.NoUpdate)
> 
> seemed to be the option. However I get 'arg 1 - set selection model has 
> invalid type' I cant get round this.QItemSelectionModel is part of QtGui. It 
> is in PyQt docs so It is implemented.

Please try to read the docs again. QItemSelectionModel.NoUpdate is a
selection flag, which can be set on the QItemSelectionModel.
setSelectionModel needs to get a QItemSelectionModel instance, not a
SelectionFlag.

And last but not least: You're actually looking for setSelectionMode and
the selection mode "NoSelection" both are members of the
QAbstractItemView class.

Andreas

-- 
You will live a long, healthy, happy life and make bags of money.




More information about the PyQt mailing list