Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QTimer from a non QThread
QtWS25 Last Chance

QTimer from a non QThread

Scheduled Pinned Locked Moved Unsolved General and Desktop
qtimerqthreadmain
3 Posts 3 Posters 1.9k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • slillyS Offline
    slillyS Offline
    slilly
    wrote on last edited by
    #1

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

    kshegunovK JKSHJ 2 Replies Last reply
    0
    • slillyS slilly

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

      kshegunovK Offline
      kshegunovK Offline
      kshegunov
      Moderators
      wrote on last edited by
      #2

      @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.

      Read and abide by the Qt Code of Conduct

      1 Reply Last reply
      0
      • slillyS slilly

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

        JKSHJ Offline
        JKSHJ Offline
        JKSH
        Moderators
        wrote on last edited by
        #3

        @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().

        Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved