Results 1 to 8 of 8

Thread: QTimer can only be used with threads started with QThread

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2012
    Location
    Armenia/Yerevan
    Posts
    400
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11
    Thanks
    15
    Thanked 16 Times in 15 Posts

    Default Re: QTimer can only be used with threads started with QThread

    Quote Originally Posted by amleto View Post
    1) What class is that code in?
    2) Where in your code is the class instance from 1) created?
    3) Show how this 'where' from 2) relates to the threads in your code.
    I updated my previous post. You may have a look at the updated code.
    about question No. 2, every object is defined in main: like for the above case:

    fuelSys *fue.. = new Fue...()

    about question 3), I did not define my objects as QThreads, They are simply OBJECTS Inheriting QObject only, as it enables the objects to communicate
    via emission and reception.

    So, you have any idea how I can make all singleShots inside my objects work?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: QTimer can only be used with threads started with QThread

    Did you remember to create a QApplication object?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Sep 2011
    Posts
    1,241
    Qt products
    Qt4
    Platforms
    Windows
    Thanks
    3
    Thanked 127 Times in 126 Posts

    Default Re: QTimer can only be used with threads started with QThread

    Quote Originally Posted by saman_artorious View Post
    I updated my previous post. You may have a look at the updated code.

    about question No. 2, every object is defined in main: like for the above case:
    Unusual. Please show your main.
    If you have a problem, CUT and PASTE your code. Do not retype or simplify it. Give a COMPLETE and COMPILABLE example of your problem. Otherwise we are all guessing the problem from a fabrication where relevant details are often missing.

Similar Threads

  1. Replies: 8
    Last Post: 27th March 2013, 11:51
  2. Using QTimer in a QThread
    By Cruz in forum Qt Programming
    Replies: 38
    Last Post: 25th April 2011, 11:29
  3. QTimer within QThread
    By Eos Pengwern in forum Qt Programming
    Replies: 6
    Last Post: 23rd February 2011, 20:00
  4. QThread and QTimer
    By sivrisinek in forum Qt Programming
    Replies: 4
    Last Post: 30th April 2009, 16:41
  5. QThread & QTimer
    By hosseinyounesi in forum Qt Programming
    Replies: 5
    Last Post: 13th April 2009, 08:22

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.