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. how to create a window which overlay on the mainwindow, and also can be dock on the maindow?
Qt 6.11 is out! See what's new in the release blog

how to create a window which overlay on the mainwindow, and also can be dock on the maindow?

Scheduled Pinned Locked Moved General and Desktop
12 Posts 2 Posters 3.1k Views 2 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.
  • O Offline
    O Offline
    opengpu2
    wrote on last edited by
    #1

    how to create a window which overlay on the mainwindow, and also can be dock on the maindow?
    which class should i inherite? QDockWidget?
    and i want the window (which can dock on mainwindow) Not Docked but show on the center over the mainwindow.
    thank you!

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

      Hi,

      When you say center over the main window, do you mean that is should completely cover it ?
      Can that dock widget be moved at all ?

      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
      • O Offline
        O Offline
        opengpu2
        wrote on last edited by
        #3

        it's like a Wizard, or non-modal widget.
        when the app startup, the mainwindow shows, and the "wizard" is another window which is separately there above the mainwindow.
        the "wizard" can be moved, scaled, etc. separately with the mainwindow.
        But, the "wizard" is able to Dock on the mainwindow.

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

          Then just create a QWizard if it suites the definition of your wizard and put it in a QDockWidget

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

            no, i don't need a wizard, i just use it to express what i need.
            by the way, can a wizard not Docked when the app startup, and then u can drag and dock it in the mainwindow?
            and i don't know wether u use VisualStudio, the docview which shows the cpp code, is what i need.

            1. can be a separate window (non modal dialog) from the mainwindow.
            2. can be a DockWidget on the mainwindow
            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              What you describe as a separated window sounds like an undocked QDockWidget.

              If you want by default your wizard to be undocked just don't dock it at creation time.

              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
              • O Offline
                O Offline
                opengpu2
                wrote on last edited by
                #7

                ok, i tried QDockWidget.
                but i don't know to make it a separate window lay over the mainwindow.
                what APIs should i use ?

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

                  Can you show a picture of what you mean by "lay over the mainwindow" ?

                  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
                  • O Offline
                    O Offline
                    opengpu2
                    wrote on last edited by
                    #9
                    This post is deleted!
                    1 Reply Last reply
                    0
                    • O Offline
                      O Offline
                      opengpu2
                      wrote on last edited by
                      #10

                      link text
                      like this, an unmodal dialog. but can dock on the mainwindow

                      1 Reply Last reply
                      0
                      • O Offline
                        O Offline
                        opengpu2
                        wrote on last edited by
                        #11

                        how can i upload a local image?

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

                          You are showing a modal dialog on a website, which is not exactly the same thing as a non modal dialog over a QMainWindow.

                          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