[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyQt] QTableWidget Data Paste Time
From:       B Clowers <clowersb () yahoo ! com>
Date:       2008-07-31 15:23:00
Message-ID: 484780.99711.qm () web31704 ! mail ! mud ! yahoo ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


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?

Cheers,

Brian


--- On Thu, 7/31/08, David Douard <david.douard@logilab.fr> wrote:
From: David Douard <david.douard@logilab.fr>
Subject: Re: [PyQt] QTableWidget Data Paste Time
To: pyqt@riverbankcomputing.com
Date: Thursday, July 31, 2008, 3:24 AM

On Wed, Jul 30, 2008 at 02:22:38PM -0700, Glenn Linderman wrote:
> On approximately 7/30/2008 2:10 PM, came the following characters from  
> the keyboard of B Clowers:
> > Greetings,
> > 
> > I'm interested in incorporating a QTableWidget into one of my  
> > applications and would like to give it the functionality to cut, copy,
 
> > and paste a user selection.  So far I've implemented the copy and 

> > paste actions to a functional level.  However, I often deal with very 

> > large arrays (e.g. 250000) rows, as such when pasting an array of that
 
> > size it seems to take on the order of 8-10 seconds to actually set the
 
> > data in the table.  I've attached a small example script that has
the  
> > copy and paste functionality and was hoping some of the more  
> > experienced programmers out there could take a look and comment on  
> > whether it is possible to commit data to the QTableWidget in a more  
> > efficient manner.  So far I've only been able to use the setItem()
 
> > function iteratively.  There doesn't seem to be a setItems() (i.e.
 
> > setting a large list of items at one time).  Thanks for your help.
> > 
> > Brian
> > 
> > -ps I didn't attach a text file with 250000 rows as it is about
1MB  
> > compressed, though if anyone is interested let me know and I'll
send  
> > it on.
> > 
> > 
> So, I'm a PyQt newbie, so I can't help, but I can add that
I've also  
> noticed that originally populating a large QTableWidget takes a long 
> time.

The solution for this is to use a QTableView and a QTableModel. See Qt
documentation on
http://doc.trolltech.com/4.4/model-view-introduction.html

and examples in PyQt (eg. in examples/itemviews ).



> 
> So if someone can offer help, it would help us both!
> 
> -- 
> Glenn -- http://nevcal.com/
> ===========================
> A protocol is complete when there is nothing left to remove.
> -- Stuart Cheshire, Apple Computer, regarding Zero Configuration
Networking
> 
> _______________________________________________
> PyQt mailing list    PyQt@riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
> 

-- 
David Douard                        LOGILAB, Paris (France), +33 1 45 32 03 12
Formations Python, Zope, Debian :   http://www.logilab.fr/formations
Développement logiciel sur mesure : http://www.logilab.fr/services
Informatique scientifique :         http://www.logilab.fr/science
_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt


      


[Attachment #5 (text/html)]

<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: \
inherit;"><br>Thanks for the information.&nbsp; I was hoping to avoid the model-view \
as it is pretty daunting task especially for someone new to programming.&nbsp; 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>&lt;david.douard@logilab.fr&gt;</i></b> wrote:<br><blockquote \
style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: \
5px;">From: David Douard &lt;david.douard@logilab.fr&gt;<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>&gt; On approximately 7/30/2008 2:10 PM, came the following \
characters from  <br>&gt; the keyboard  of B Clowers:<br>&gt;&gt; \
Greetings,<br>&gt;&gt;<br>&gt;&gt; I'm interested in incorporating a QTableWidget \
into one of my  <br>&gt;&gt; applications and would like to give it the functionality \
to cut, copy,<br> <br>&gt;&gt; and paste a user selection.  So far I've implemented \
the copy and <br><br>&gt;&gt; paste actions to a functional level.  However, I often \
deal with very <br><br>&gt;&gt; large arrays (e.g. 250000) rows, as such when pasting \
an array of that<br> <br>&gt;&gt; size it seems to take on the order of 8-10 seconds \
to actually set the<br> <br>&gt;&gt; data in the table.  I've attached a small \
example script that has<br>the  <br>&gt;&gt; copy and paste functionality and was \
hoping some of the more  <br>&gt;&gt; experienced programmers out there could take a \
look and comment on  <br>&gt;&gt; whether it is possible to commit data to the \
QTableWidget in a more  <br>&gt;&gt; efficient manner.  So far I've only been able to \
use the setItem()<br>  <br>&gt;&gt; function iteratively.  There doesn't seem to be a \
setItems() (i.e.<br> <br>&gt;&gt; setting a large list of items at one time).  Thanks \
for your help.<br>&gt;&gt;<br>&gt;&gt; Brian<br>&gt;&gt;<br>&gt;&gt; -ps I didn't \
attach a text file with 250000 rows as it is about<br>1MB  <br>&gt;&gt; compressed, \
though if anyone is interested let me know and I'll<br>send  <br>&gt;&gt; it \
on.<br>&gt;&gt;<br>&gt;&gt;<br>&gt; So, I'm a PyQt newbie, so I can't help, but I can \
add that<br>I've also  <br>&gt; noticed that originally populating a large \
QTableWidget takes a long <br>&gt; 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>&gt;<br>&gt; So if someone can \
offer help, it would help us both!<br>&gt;<br>&gt; -- <br>&gt; Glenn -- \
http://nevcal.com/<br>&gt;  ===========================<br>&gt; A protocol is \
complete when there is nothing left to remove.<br>&gt; -- Stuart Cheshire, Apple \
Computer, regarding Zero Configuration<br>Networking<br>&gt;<br>&gt; \
_______________________________________________<br>&gt; PyQt mailing list    \
PyQt@riverbankcomputing.com<br>&gt; \
http://www.riverbankcomputing.com/mailman/listinfo/pyqt<br>&gt;<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>


      



_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic