Results 1 to 2 of 2

Thread: Sleep My Program when it running ?

  1. #1
    Join Date
    Mar 2010
    Posts
    92
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60

    Default Sleep My Program when it running ?

    i want sleep my program like Sleep( milisecond ) in windows.h ,can you help me ?

  2. #2
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Sleep My Program when it running ?

    Try to write your class, inherited from QThread and call parent function msleep
    Qt Code:
    1. class Sleeper : public QThread
    2. {
    3. public:
    4. static void go( int ms )
    5. {
    6. msleep( ms );
    7. }
    8. };
    To copy to clipboard, switch view to plain text mode 
    and call it like this
    Qt Code:
    1. Sleeper::go( 1000 );
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. How to check if a program is running?
    By raphaelf in forum Newbie
    Replies: 16
    Last Post: 30th April 2010, 15:59
  2. Qt Program Not running
    By Nishant in forum Newbie
    Replies: 0
    Last Post: 6th April 2010, 19:29
  3. Help me how to know the program is running
    By vql in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2008, 12:43
  4. not running the application program
    By sudheer in forum Newbie
    Replies: 11
    Last Post: 5th December 2007, 07:35
  5. Replies: 1
    Last Post: 17th May 2006, 00:23

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.