On Fri, Dec 3, 2010 at 15:56, Wolfgang Rohdewald <wolfg...@rohdewald.de>wrote:

> 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.
>

Thats not logical.
http://doc.trolltech.com/4.7/qsqltablemodel.html#rowCountdoesn't
mention what is exactly rowCount, and one should expect the number
of rows based on the name...

fetchMore will then fetch all rows. I don't want that, just would like to
know the number of rows, or just load the last record.

> 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.
>
Sounds reasonable, thanks.
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to