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. Cannot stop QTimer from another thread
Forum Updated to NodeBB v4.3 + New Features

Cannot stop QTimer from another thread

Scheduled Pinned Locked Moved Unsolved General and Desktop
4 Posts 4 Posters 514 Views 1 Watching
  • 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.
  • J Offline
    J Offline
    John Howe
    wrote on last edited by
    #1

    I hope this is an easy one. I received an error during shutdown of my app that was roughly "Cannot stop a QTimer from another thread."

    I'm not doing anything to deliberately call the Timer->stop() or the Timer->~QTimer() methods from a different thread. Suggestions on how to troubleshoot?

    kshegunovK 1 Reply Last reply
    0
    • nageshN Offline
      nageshN Offline
      nagesh
      wrote on last edited by
      #2

      do you have any timer->stop() in your code?
      In which thread QTimer object created? what is the current thread affinity of QTimer object?

      1 Reply Last reply
      1
      • J John Howe

        I hope this is an easy one. I received an error during shutdown of my app that was roughly "Cannot stop a QTimer from another thread."

        I'm not doing anything to deliberately call the Timer->stop() or the Timer->~QTimer() methods from a different thread. Suggestions on how to troubleshoot?

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

        @John-Howe said in Cannot stop QTimer from another thread:

        Suggestions on how to troubleshoot?

        Set QT_FATAL_WARNINGS as an environment variable with a value of 1. Run your program in the debuger, when it crashes (which it will at the point of the "Cannot stop a QTimer from another thread." warning) extract a stack trace. Post it here.
        That warning usually means that something's not right with your objects' thread affinity.

        Read and abide by the Qt Code of Conduct

        1 Reply Last reply
        7
        • A Offline
          A Offline
          anil_arise
          wrote on last edited by
          #4

          use user define signal instead of direct stop to Qtimer from another thread.

          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