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

Qt-interest Archive, May 2007
sleeping whilst GUI runs


Message 1 in thread

Hi everyone

I have a problem where I need to allow a device I'm monitoring to wait
for 5 seconds before taking more data.  The monitoring function is part
of a QWidget class called k_master.  I have another class which displays
other information about the device (which is provided by the k_master
class).  Is there a way I can make the function wait whilst the rest of
the code carries on running.  Do I need to use threads for this?

Ross

--
 [ signature omitted ] 

Message 2 in thread

----- Original Message ----- 
From: "Ross Williamson" <rw247@xxxxxxxxxxxxxxxxxx>
To: <qt-interest@xxxxxxxxxxxxx>
Sent: Friday, May 04, 2007 8:58 PM
Subject: sleeping whilst GUI runs


> Hi everyone
>
> I have a problem where I need to allow a device I'm monitoring to wait
> for 5 seconds before taking more data.  The monitoring function is part
> of a QWidget class called k_master.  I have another class which displays
> other information about the device (which is provided by the k_master
> class).  Is there a way I can make the function wait whilst the rest of
> the code carries on running.  Do I need to use threads for this?
>
> Ross
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>

Ross,

You could use QTimer, and while processing data call 
QApplication::processEvents() from time to time. This will make GUI 
responsive
if processing takes too long.

Yuriy


--
 [ signature omitted ]