Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-1359

QThread with parent and QObject worker blocks main thread

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.15.0
    • Fix Version/s: None
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      Windows 10 Pro build 19042.423, Python 3.8 x86 and x64
    • Platform/s:
      Windows

      Description

      When creating a QThread and connecting slots to a QObject as a "worker" to wrap a function or method, if a parent (in this case a subclass of QMAinWindow) is assigned to the QThread calling QThread.start() blocks the main thread. This issue does not occur with PyQt5. A minimal example is attached to demonstrate this behavior. Changing the line "self.test_thread = create_thread(self.long_running_task, parent=self)" and setting the parent to None fixes the issue.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            crmaurei Cristian Maureira-Fredes
            Reporter:
            spikespaz Jacob Birkett
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes