[Qt-interest] How to use QTime

Malyushytsky, Alex alex at wai.com
Fri Apr 17 00:05:55 CEST 2009


According to my understanding QTime does not generate delays, it just profides access to the system time and allows you to make some math with time obtained.

You probably want to use it in combination with QTimer.

Regards,

Alex

-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Parameshwari
Sent: Thursday, April 16, 2009 6:12 AM
To: qt-interest at trolltech.com
Subject: [Qt-interest] How to use QTime

Hi All,


                I have tried this code to generate a delay before displaying
the Frame which is :


    QTime time = QTime::currentTime();      // get the current time
    QTime time2= QTime::currentTime().addSecs(5);
    this->showMaximized();
    while(time >= time2 )
    {
        time = QTime::currentTime();
    }
    this->close();

But it is not working well. I am not sure whether i have done any mistake in
the above code.
In the file , The Window is maximized only. It' not even entering to the
"while" loop i believe.
Some one correct me.


Regards
Param


_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest


---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.

"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."

"Please consider our environment before printing this email."




More information about the Qt-interest-old mailing list