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. Does a running timer in the event loop prevent app from terminating?
Forum Updated to NodeBB v4.3 + New Features

Does a running timer in the event loop prevent app from terminating?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.8k 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.
  • B Offline
    B Offline
    bootchk
    wrote on last edited by
    #1

    My app process does not appear to terminate when I close the last window (the appropriate flags are set on the window.) Could it be because I have a timer still running?

    I set flags on main window:
    @self.setAttribute(Qt.WA_DeleteOnClose, True)
    self.setAttribute(Qt.WA_QuitOnClose, True)@

    My model is that the QApplication quits when the last top-level window is closed, but the event loop is not the same thing. The QApplication quitting simply means that it takes its handler out of the event loop (the handler that polls for events from the user and window manager.) The event loop only terminates the application process (by returning) if the event loop is empty. Which it will not do if a running timer exists.

    I suppose I could read the source code....

    The context is a functional testing tool, where my timer in the event loop is inspecting the running app.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      miroslav
      wrote on last edited by
      #2

      I am quite certain that a pending timer does not prevent the event loop from exiting.

      Mirko Boehm | mirko@kde.org | KDE e.V.
      FSFE Fellow
      Qt Certified Specialist

      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