Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. multiple main windows
Forum Updated to NodeBB v4.3 + New Features

multiple main windows

Scheduled Pinned Locked Moved Unsolved Qt for Python
5 Posts 2 Posters 658 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.
  • A Offline
    A Offline
    andocromn
    wrote on last edited by
    #1

    I'm trying to write a program using QT windows and an API which uses PubNub notifications. The program should run in the background until a notification, then either open a new QT window or modify an existing QT window. I've tried this a couple different ways but I keep getting errors like the one below

    QObject: Cannot create children for a parent that is in a different thread.

    Any advise would be appreciated

    JonBJ 1 Reply Last reply
    0
    • A andocromn

      I'm trying to write a program using QT windows and an API which uses PubNub notifications. The program should run in the background until a notification, then either open a new QT window or modify an existing QT window. I've tried this a couple different ways but I keep getting errors like the one below

      QObject: Cannot create children for a parent that is in a different thread.

      Any advise would be appreciated

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @andocromn
      Don't use threads unless you really, really need to. If you do, you need to understand Qt threading thoroughly. The error message tells you which restriction of threading you are breaking.

      A 1 Reply Last reply
      1
      • JonBJ JonB

        @andocromn
        Don't use threads unless you really, really need to. If you do, you need to understand Qt threading thoroughly. The error message tells you which restriction of threading you are breaking.

        A Offline
        A Offline
        andocromn
        wrote on last edited by
        #3

        @JonB I believe it is the ringcentral API that I am using, which uses threading. do you know if there is any way to create QT windows within a thread?

        JonBJ 1 Reply Last reply
        0
        • A andocromn

          @JonB I believe it is the ringcentral API that I am using, which uses threading. do you know if there is any way to create QT windows within a thread?

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by JonB
          #4

          @andocromn
          For Qt you must only do UI operations in the main thread. You must not so something like "create a window in another thread". [EDIT To be fair there is QObject::moveToThread(QThread *targetThread). So I shouldn't quite say what I did. But your error is for this reason.]

          A 1 Reply Last reply
          1
          • JonBJ JonB

            @andocromn
            For Qt you must only do UI operations in the main thread. You must not so something like "create a window in another thread". [EDIT To be fair there is QObject::moveToThread(QThread *targetThread). So I shouldn't quite say what I did. But your error is for this reason.]

            A Offline
            A Offline
            andocromn
            wrote on last edited by
            #5

            @JonB Understood, thank you for commenting and explaining. I was starting to wonder if it was a compatibility issue between QT and this API's code

            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