[PyKDE] Huge amount of time

Greg Fortune lists at gregfortune.com
Wed Aug 20 21:30:01 BST 2003


See the QTable documentation for Large Tables or, more specifically, 
http://doc.trolltech.com/3.2/table-bigtable-main-cpp.html for example C++ code 
that handles a 1,000,000 X 1,000,000 table. You'll probably find that the 
code that is slowing you down is not your loop, but the setNumCols and 
setNumRows calls and the Large Tables documentation deals specifically with 
this...


If you've got 65536 rows and a large number of columns and don't expect to 
have a "sparse" (ie, lots of empty cells) table, you will probably have to 
work out some kind of on-demand retrieval code, fake having the whole table 
loaded by only having enough cells to display part of the table, and then 
retrieving data when the user scrolls.  If the table isn't sparse and you 
load the whole thing, there is no way around it consuming lots of memory.  
Good luck,

Greg Fortune
Fortune Solutions


On Wednesday 20 August 2003 11:29 am, Carlos Moreira wrote:
> Hello,
>
>      I have a very simple QTable with 65536 rows. I
> need to change the row labels to hex, I do this by
> using the code below:
>
> <code>
> for line_label in
> range(0,self.verticalHeader().count()):
>      self.verticalHeader().setLabel(line_label, "#" +
> (hex(line_label)[2:].upper()).zfill(4) )
> </code>
>
> But I need some help.....this simple code take a huge
> of time to change all row header labels. Is there some
> alternative to program this ?
>
>                Thanks
>
> Cadu
>
> __________________________________
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
>
> _______________________________________________
> PyKDE mailing list    PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde




More information about the PyQt mailing list