QTimer from a non QThread



  • Can QTimer be called from a normal C++ main and not a QThread or a main using a QCoreApplication?


  • Qt Champions 2016

    @slilly

    Can QTimer be called from

    What does this mean?
    A timer object will generate the timeout() signal at (almost) regular intervals, you can subscribe to that and do whatever you want. What do you want to call from a QTimer instance? If you mean to use QTimer without an event loop (i.e. without QCoreApplication), well then, no you can't do that.


  • Moderators

    @slilly said:

    Can QTimer be called from a normal C++ main and not a QThread or a main using a QCoreApplication?

    No. If you want to use QTimer, then you need QCoreApplication::exec() or QThread::exec().


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.