Results 1 to 5 of 5

Thread: Pausing a Thread running an infinite loop (Qt+OpenCV)

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Jan 2006
    Location
    Sta. Eugènia de Berga (Vic - Barcelona - Spain)
    Posts
    869
    Thanks
    70
    Thanked 59 Times in 57 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Pausing a Thread running an infinite loop (Qt+OpenCV)

    Hi,

    If you only want to wait for 10 seconds you can call "msleep" method from a QThread. So, add this code on line 23:
    Qt Code:
    1. QThread::currentThread()->msleep(10000);
    To copy to clipboard, switch view to plain text mode 
    Òscar Llarch i Galán

  2. The following user says thank you to ^NyAw^ for this useful post:

    franco.amato (28th October 2019)

Similar Threads

  1. Qt window resize without infinite loop
    By rpvpqq in forum Newbie
    Replies: 1
    Last Post: 15th April 2019, 16:34
  2. Problem pausing the main thread
    By franco.amato in forum Qt Programming
    Replies: 3
    Last Post: 11th May 2011, 21:47
  3. Pausing a thread while waiting that phonon play a sound file
    By franco.amato in forum Qt Programming
    Replies: 1
    Last Post: 21st March 2011, 21:41
  4. Infinite loop in QXmlSchemaValidator::validate()?
    By TropicalPenguin in forum Qt Programming
    Replies: 0
    Last Post: 9th November 2010, 15:09
  5. infinite loop
    By zakis in forum Qt Programming
    Replies: 1
    Last Post: 4th November 2009, 17:52

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.