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