PDA

View Full Version : More CPU Load when using SetText



arunvv
23rd January 2008, 02:23
Hi,

Iam Using Qtopia -4.2. I am writing an application which had 3 tabs and under each tab I had 3 more sub tabs. Each sub tab had 10-15 line edit boxes will get data and each line edit box need to be updated for every 200ms using QTimer.

I am using setText for updating the boxes. It seems to me setText is utilising more CPU load. So is there any other way to update the Lineedit boxes. It is just to display the text on to line edit.

Thanks & Regards,
Arun

jpn
23rd January 2008, 07:20
I would suggest using item views instead of loads of line edit widgets.

arunvv
23rd January 2008, 19:06
Thanks for your reply.

How can I use item views for displaying text. Can you give me a piece of code for displaying any text string.

Thanks & Regards,
Arun.

jpn
23rd January 2008, 19:35
Take a look at Qt Widget Gallery (http://doc.trolltech.com/latest/gallery.html), specifically "Item Views". Decide whether you want a list, tree or table. It's easiest to start with item based convenience classes, QListWidget, QTreeWidget or QTableWidget. Take a look at their documentation. Each class provides example code snippets in "detailed description".