[Qt-interest] idle state of application

Thiago Macieira thiago.macieira at trolltech.com
Wed Feb 11 14:50:24 CET 2009


Em Quarta-feira 11 Fevereiro 2009, às 16:01:46, Puneet Bisht escreveu:
> hi all,
> i m facing a strange problem with qt 3.3.
> we have a separate worker thread(QThread).within which a number of
> Qprocess objects are created , every qprocess object update the list view
> after successful completion.
> now after some time if we leave the system i.e our application is
> processing but system is in idle state , qprocess is unable to update the
> listview , but if we generate some interrupt e.g mouse move event on
> application , it immediately updates the list view.
> this is affecting our application's speed.
>
> please help me on this , i m new to qt

Hello Puneet

First of all, since you're saying you're new to Qt, the first advice we have to 
give you is to not use Qt 3. That version has reached End-of-Life and has no 
further bugfixes or releases.

Please start new application development with Qt 4 only.

Next: please understand that Qt GUI classes can only be accessed from the main 
thread (also known as GUI thread): it's the default thread, the one where the 
QApplication class is created and app.exec() is called.

Any use of GUI classes outside that thread is invalid and will lead to 
crashes, unexpected behaviour and/or corruption of data. I believe this is 
your problem here.

What's more, in Qt 3, the QProcess class can only be used from the GUI thread 
as well, even if it's not GUI. This is a restriction that has been lifted in 
Qt 4, so it is more incentive for you to upgrade.

-- 
Thiago Macieira - thiago.macieira (AT) nokia.com
  Senior Product Manager - Nokia, Qt Software
     Sandakerveien 116, NO-0402 Oslo, Norway
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090211/98ec7b44/attachment.bin 


More information about the Qt-interest-old mailing list