Trolltech Home | Qt-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 3

Qt-interest Archive, March 2002
AW: qlist prob


Message 1 in thread

1. don't use: "insertItem()", you do not need to call this unless you've
called "takeItem()" first.
2. making a for with 1-49999 is a highly blocking programming style, there
will be no update at all I guess. Insert a smal delay inside the for{} is a
minimum to do. Anyway using a listview with 49999 entrys can slow down your
listview extremly, where will you need that?
3. do "ListView->viewport()->setUpdatesEnabled(TRUE);" outside the for you
call this 49998 more then you need...
4. you don't need to call triggerUpdate()...

-----Ursprüngliche Nachricht-----
Von: rohit sharma [mailto:rohits79@yahoo.com]
Gesendet: Donnerstag, 07. März 2002 13:25
An: qt-interest@trolltech.com
Betreff: qlist prob


hi 

I am newbie with QT programming and this is my first
post to the list.

I start off with a simple qt3 program but seems i am
running somewhere to the walls ... ouchh!!!

i tried to fill my listview with some data but since
it didn't worked the way i wanted i tried to run a
simple test code is in the body.

i used qt3designer and created a small dialog app with
list view , i named the obj varialbe as ListView now
when i tried to input some values it refreshes and
updates the list view only after the 50000 loops.what
i want is to update it after each and every recurse.

any pointers please . 

cheers
Rohit

for(int i=1;i<50000;i++)
{
ListView->viewport()->setUpdatesEnabled(TRUE);
ListView->triggerUpdate();
QString label1="rohit";
QListViewItem * item = new
QListViewItem(ListView,label1);
ListView->insertItem(item);

}   




__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

--
 [ signature omitted ]