[PyQt] QSqlTableModel.rowCount bug? (and still need infor for beforeInsert)

Wolfgang Rohdewald wolfgang at rohdewald.de
Fri Dec 3 14:56:38 GMT 2010


On Freitag 03 Dezember 2010, KONTRA, Gergely wrote:
> Hi all!
> 
> I suspect QSqlTableModel.rowCount cannot return numbers above
> 256.

rowCount is not the number of rows in the table but in the model, 
AFAIK. Use fetchMore() to load more.

> And can somebody tell me why this code is this painfully 
slooow?

you execute 300 transactions. If you use db.transaction()
after db.open() and db.commit() after model.submitAll(), this
is only one transaction and much faster.

-- 
Wolfgang


More information about the PyQt mailing list