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. Implementing Simple Window System

Implementing Simple Window System

Scheduled Pinned Locked Moved General and Desktop
10 Posts 5 Posters 2.9k 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.
  • D Offline
    D Offline
    Dword0x0
    wrote on last edited by
    #1

    I'm trying to implement a system of windows in which there are two windows. When each of the respective windows is active, it can be displayed over the other window. However, only a single window should be shown in the task manager (when the user presses alt-tab only one window should be shown for my application).

    I have tried to approach this from a few different angles:

    I have tried having two parentless windows and giving one of them the Qt::Tool flag. This approach works until alt-tab is pressed. Once this happens, the tool window disappears, although it is still considered "visible" by the API (when the isVisible() method is called, it returns true even though the window is not visible).

    I have also tried parenting one window (call it window B) to the other window (call it window A) and then switched the parenting by invoking the setParent() method whenever the current parent window becomes active. This allows the active window to be rendered over the inactive window. This approach causes both windows to momentarily close each time another window becomes active, causing the windows to "blink."

    Is there any simpler/better way to approach this problem?

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      QStackedWidget?

      (Z(:^

      1 Reply Last reply
      0
      • D Offline
        D Offline
        Dword0x0
        wrote on last edited by
        #3

        I've looked into QStackedWidget, but I'd like to have the two windows be separate, so that the user can see things in both windows at the same time.

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

          Maybe a MDI approach ?

          http://qt-project.org/doc/qt-4.8/mainwindows-mdi.html

          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
          • D Offline
            D Offline
            Dword0x0
            wrote on last edited by
            #5

            I guess I could have the two windows contained within an MDI main window. I was hoping to tackle this with SDI though.

            1 Reply Last reply
            0
            • Q Offline
              Q Offline
              qxoz
              wrote on last edited by
              #6

              You mean GIMP or Delphi kind UI?
              In this case you any way should have one parent window . Then create other window:
              @QMainWindow *windB = new QMainWindow(this/or parent window pointer/);
              ...
              winB->show();@

              in taskmanager you get only one window. App closes when close main parent window.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                Dword0x0
                wrote on last edited by
                #7

                Using this method, the intended effect of having either window be rendered over the other one (depending upon which one is active) is not achieved.

                1 Reply Last reply
                0
                • K Offline
                  K Offline
                  kenchan
                  wrote on last edited by
                  #8

                  How about having two separate processes sending messages to each other and behaving accordingly?

                  1 Reply Last reply
                  0
                  • K Offline
                    K Offline
                    kenchan
                    wrote on last edited by
                    #9

                    Sorry forgot to ask what operating system are you using in particular or are you trying to do it with only Qt dependencies. I dumb question on my part maybe :-(

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      Dword0x0
                      wrote on last edited by
                      #10

                      The target OS for my application is Windows. I'm not sure how this approach would help, especially with regards to having only a single window be displayed when the user presses alt-tab.

                      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