<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><br>Thanks for the information. I was hoping to avoid the model-view as it is pretty daunting task especially for someone new to programming. I don't suppose that anyone out there may be willing to share and example of how to paste data from the clipboard into a QTableView?<br><br>Cheers,<br><br>Brian<br><br><br>--- On <b>Thu, 7/31/08, David Douard <i><david.douard@logilab.fr></i></b> wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;">From: David Douard <david.douard@logilab.fr><br>Subject: Re: [PyQt] QTableWidget Data Paste Time<br>To: pyqt@riverbankcomputing.com<br>Date: Thursday, July 31, 2008, 3:24 AM<br><br><pre>On Wed, Jul 30, 2008 at 02:22:38PM -0700, Glenn Linderman wrote:<br>> On approximately 7/30/2008 2:10 PM, came the following characters from <br>> the keyboard
of B Clowers:<br>>> Greetings,<br>>><br>>> I'm interested in incorporating a QTableWidget into one of my <br>>> applications and would like to give it the functionality to cut, copy,<br> <br>>> and paste a user selection. So far I've implemented the copy and <br><br>>> paste actions to a functional level. However, I often deal with very <br><br>>> large arrays (e.g. 250000) rows, as such when pasting an array of that<br> <br>>> size it seems to take on the order of 8-10 seconds to actually set the<br> <br>>> data in the table. I've attached a small example script that has<br>the <br>>> copy and paste functionality and was hoping some of the more <br>>> experienced programmers out there could take a look and comment on <br>>> whether it is possible to commit data to the QTableWidget in a more <br>>> efficient manner. So far I've only been able to use the setItem()<br>
<br>>> function iteratively. There doesn't seem to be a setItems() (i.e.<br> <br>>> setting a large list of items at one time). Thanks for your help.<br>>><br>>> Brian<br>>><br>>> -ps I didn't attach a text file with 250000 rows as it is about<br>1MB <br>>> compressed, though if anyone is interested let me know and I'll<br>send <br>>> it on.<br>>><br>>><br>> So, I'm a PyQt newbie, so I can't help, but I can add that<br>I've also <br>> noticed that originally populating a large QTableWidget takes a long <br>> time.<br><br>The solution for this is to use a QTableView and a QTableModel. See Qt<br>documentation on<br>http://doc.trolltech.com/4.4/model-view-introduction.html<br><br>and examples in PyQt (eg. in examples/itemviews ).<br><br><br><br>><br>> So if someone can offer help, it would help us both!<br>><br>> -- <br>> Glenn -- http://nevcal.com/<br>>
===========================<br>> A protocol is complete when there is nothing left to remove.<br>> -- Stuart Cheshire, Apple Computer, regarding Zero Configuration<br>Networking<br>><br>> _______________________________________________<br>> PyQt mailing list PyQt@riverbankcomputing.com<br>> http://www.riverbankcomputing.com/mailman/listinfo/pyqt<br>><br><br>-- <br>David Douard LOGILAB, Paris (France), +33 1 45 32 03 12<br>Formations Python, Zope, Debian : http://www.logilab.fr/formations<br>Développement logiciel sur mesure : http://www.logilab.fr/services<br>Informatique scientifique : http://www.logilab.fr/science<br></pre><pre>_______________________________________________<br>PyQt mailing list PyQt@riverbankcomputing.com<br>http://www.riverbankcomputing.com/mailman/listinfo/pyqt</pre></blockquote></td></tr></table><br>