[PyKDE] Re: PyQt application freezing on long operations

Carlos Eduardo cedepaula at yahoo.com.br
Mon Jan 22 21:25:20 GMT 2007


Hans-Peter Jansen <hpj <at> urpla.net> writes:

> 
> 
> You're way to sparse with description of your environment/approaches to give 
> you helpful answers. 
> 
> One nice thing of Qt3 QDataTables is, you don't need to care about the 
> number of rows, at least as long as the database[server] is fast enough to 
> deliver the first bunch of records (500?). Qt manages the "fetch when used" 
> quite effective behind the scenes. I'm using it on tables with 60000 
> records without noticable delays - as long as I don't try to iterate 
> through the result set myself. 
> 
> KR,
>   Pete

I´m using Python 2.5, Qt4.2.2 and latest PyQt snapshot... i made the application
DB access using sqlite3 and cx_Oracle modules, for each of them I created a
class that has the same functionaliti for all DB´s (get tables, make queries,
get indexes...) .. like a wrapper for underlying drivers.

I did exactly what you said... i´m iterating myself over the results, and
inserting them on the table.

Here a example on what i did:

lines = query()
for line in lines:
    my.table.addItem(line)

def query():
   cursor.execute('select * from abc')
   return cursor.fetchall()


I will look into QT classes for data handling tomorrow... 

Thanks,

Carlos





More information about the PyQt mailing list