Results 1 to 4 of 4

Thread: how to enable a timer in a non-gui thread?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2007
    Posts
    51
    Thanks
    2
    Thanked 2 Times in 2 Posts

    Default Re: how to enable a timer in a non-gui thread?

    Zeopha, your problem more than likely is that you forgot to call exec() in your thread's run function. Without calling exec, the thread won't have an event loop, which is necessary for the use of QTimer.
    Read the documentation for QTimer and QThread for more info.

    I hope that answers your question.

  2. The following user says thank you to Khal Drogo for this useful post:

    zeopha (5th August 2008)

  3. #2
    Join Date
    Aug 2008
    Posts
    5
    Thanks
    3

    Default Re: how to enable a timer in a non-gui thread?

    to Lvi:
    a timer located in the main gui widget will trigger the slot in another qthread. but I just think that the timer should not be located in the gui

    to:Khal Drogo

    U r right. I had forgetten to execute the exec() in the run function of thread. So am I stupid!!!

    thanks to Liv and Khal Drogo !

Similar Threads

  1. QSocketNotifier can not enable from an other thread.
    By dabiabilus in forum Qt Programming
    Replies: 4
    Last Post: 5th August 2008, 13:31
  2. Thread, Timer and Socket. Comuication problem
    By ^NyAw^ in forum Qt Programming
    Replies: 6
    Last Post: 17th January 2008, 16:48
  3. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  4. Replies: 10
    Last Post: 20th March 2007, 22:19
  5. Problem closing a QMainWindow in Qt4.2
    By ian in forum Qt Programming
    Replies: 11
    Last Post: 17th October 2006, 00:49

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.