Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. condition to quit the thread
Qt 6.12 LTS is out! See what's new in the release blog

condition to quit the thread

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 390 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.
  • N Offline
    N Offline
    najlou
    wrote on last edited by
    #1

    hello
    I have a thread that will display a graph in a new window how I can make the condition to quit the thread is when the user clicks on the closing red cross

    jsulmJ 1 Reply Last reply
    0
    • N najlou

      hello
      I have a thread that will display a graph in a new window how I can make the condition to quit the thread is when the user clicks on the closing red cross

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @najlou said in condition to quit the thread:

      I have a thread that will display a graph in a new window

      Be aware that you are not allowed to change UI in other threads than main (GUI) thread.

      Back to your question: emit a signal if you want to stop the other thread. Connect this signal to a slot in that other thread and stop the thread in this slot.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      3

      • Login

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