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. Qt Threading mechanism
Forum Updated to NodeBB v4.3 + New Features

Qt Threading mechanism

Scheduled Pinned Locked Moved General and Desktop
3 Posts 3 Posters 834 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.
  • A Offline
    A Offline
    Amruta
    wrote on last edited by
    #1

    When we create multiple threads, is it necessary to include all UI objects in Main thread only?
    for example, if there are 20 threads in a application, can we include atleast one UI object in any thread except the Main thread.

    1 Reply Last reply
    0
    • IamSumitI Offline
      IamSumitI Offline
      IamSumit
      wrote on last edited by
      #2

      no.
      all Ui must be inside main thread.
      other wise application can be frozen for awhile

      Be Cute

      1 Reply Last reply
      0
      • TheBadgerT Offline
        TheBadgerT Offline
        TheBadger
        wrote on last edited by
        #3

        No, only the main or GUI thread can work with UI objects.

        From "this":http://qt-project.org/doc/qt-5/thread-basics.html page:
        GUI Thread and Worker Thread
        As mentioned, each program has one thread when it is started. This thread is called the "main thread" (also known as the "GUI thread" in Qt applications). The Qt GUI must run in this thread. All widgets and several related classes, for example QPixmap, don't work in secondary threads. A secondary thread is commonly referred to as a "worker thread" because it is used to offload processing work from the main thread.


        Check out my SpellChecker Plugin for Qt Creator @ https://github.com/CJCombrink/SpellChecker-Plugin

        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