Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Closing QWindows that have parents

Closing QWindows that have parents

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 737 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.
  • E Offline
    E Offline
    Eventh
    wrote on last edited by
    #1

    So in my application I have several sub QWindows that are all children of the main application window. These windows can come and go as the user sees fit by closing them.
    Is there a way to close a QWindow that has a parent? The documentation of the close function says it will fail if a parent exists. What is the correct way to just close a single child QWindow while keeping the others and the parent window open?
    Thanks!

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you explain what your application does with these QWindows objects ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • E Offline
        E Offline
        Eventh
        wrote on last edited by
        #3

        Well there are several "windows" that can be opened from a menu and displayed and also closed when the user is done with them via a button on the main application window. They are displayed in one section of the main application window and are children to this window. They are stored in QWindow objects and managed via C++. I need to do it this way because I have other windows that are controlled via DCOM that live in other processes and computers and are treated the same. They are just in RDP windows and I "embed" them into QWindows. Which works wonderfully.

        I want to be able to call close() on them when the user is done with them but the function fails since they have a parent, as the documentation mentions.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          What is the content of these QWindows ? 3D objects ? Widgets ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • E Offline
            E Offline
            Eventh
            wrote on last edited by
            #5

            They represent QML files basically. Just rectangles, listviews, etc. QtQuick. No Widgets.

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              In that case, could QQuickWidget be a solution ?

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              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