[PyQt] QTableView in Editingstate
Andreas Pakulat
apaku at gmx.de
Fri Jan 20 10:41:52 GMT 2012
On 20.01.12 11:15:17, Daniel Benden wrote:
> Hi,
>
> I hope to get some help with the following problem.
>
> First a little situation sketch:
> I have a QTableView with a custom model (subclass from QAbstractTableModel) and a custom itemdelegate(subclassed from QItemDelegate).
> The QItemDelegate provides for two of the 5 columns an custom editor. For the other columns the default QLineEdit is returned.
> The tableview is show using a QGraphicsProxyWidget is QGrapicsView.
>
> Now the problem:
> The problem is that after an editor is returned and the user can happely start to input data. However while the QTableView is in EditingState it starts to poll the model aggressivly by calling it's data method. This polling causes the editing to slow down to a crawl ( Noticable because the keyboard input becomes more or less unresponsive). Is there a way to stop the polling while QtableView is in EditingState ? Or am i doing something else horribly wrong ?
Without a crystal ball or some example code nobody can really tell :|
Things I'd suggest: Reduce your code to a small example still exhibiting
the problem and post that. Maybe replace the custom model with a
QStandardItemModel if possible. Try it without the graphicsview
rendering your table. Use the modeltest class on your model to see
wether it maybe returns wrong information that may cause the polling.
The modeltest is part of the Qt sources in the tests/auto directory.
Andreas
More information about the PyQt
mailing list