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. adding subwindow to MDI area

adding subwindow to MDI area

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 3 Posters 1.7k 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.
  • A Offline
    A Offline
    Anonymous_Banned275
    wrote on last edited by
    #1

    The attached code does add subwindoiw as minimized , however I have not found an easy way to add the object to the area - for real .

    I am actually ignorant about the "double square " icon name on the window status bar. That one put the correct window size to the MDI area - but manually - by clicking it.

    Can that be done in code ?

    mdiArea->addSubWindow(DDD)->
    setWindowState(Qt::WindowMinimized) ;

    de8b4701-660f-47cb-868f-2f757b1ee7f4-image.png

    Gojir4G 1 Reply Last reply
    0
    • A Anonymous_Banned275

      The attached code does add subwindoiw as minimized , however I have not found an easy way to add the object to the area - for real .

      I am actually ignorant about the "double square " icon name on the window status bar. That one put the correct window size to the MDI area - but manually - by clicking it.

      Can that be done in code ?

      mdiArea->addSubWindow(DDD)->
      setWindowState(Qt::WindowMinimized) ;

      de8b4701-660f-47cb-868f-2f757b1ee7f4-image.png

      Gojir4G Offline
      Gojir4G Offline
      Gojir4
      wrote on last edited by
      #2

      Hi @AnneRanch,

      Not sure about what you mean by "add the object the area - for real".
      But did you try setWindowState(Qt::WindowMaximized); ?

      Note you can also use the "Tabbed" view mode using QMdiArea::setViewMode(QMdiArea::ViewMode mode)
      hope it helps

      A 1 Reply Last reply
      3
      • Gojir4G Gojir4

        Hi @AnneRanch,

        Not sure about what you mean by "add the object the area - for real".
        But did you try setWindowState(Qt::WindowMaximized); ?

        Note you can also use the "Tabbed" view mode using QMdiArea::setViewMode(QMdiArea::ViewMode mode)
        hope it helps

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

        @Gojir4 The code "minimized" is NOT desired - hence it is not for real IMHO.
        Yes the "maximized" works fine.
        The task is to add the subwindow - such as default to "upper left corner of size the object " not as currently "minimized".
        The TAB is not my objective for now, but I'll try it.

        PS
        Can anybody name the "double square icon " ?

        Gojir4G 1 Reply Last reply
        0
        • A Anonymous_Banned275

          @Gojir4 The code "minimized" is NOT desired - hence it is not for real IMHO.
          Yes the "maximized" works fine.
          The task is to add the subwindow - such as default to "upper left corner of size the object " not as currently "minimized".
          The TAB is not my objective for now, but I'll try it.

          PS
          Can anybody name the "double square icon " ?

          Gojir4G Offline
          Gojir4G Offline
          Gojir4
          wrote on last edited by
          #4

          @AnneRanch If you need to display the subwindow using its original size (sizehint). I think you should probably not call setWindowState at all.

          The "double square icon" corrsespond to the window flag Qt::WindowMaximizeButtonHint

          A 1 Reply Last reply
          1
          • Gojir4G Gojir4

            @AnneRanch If you need to display the subwindow using its original size (sizehint). I think you should probably not call setWindowState at all.

            The "double square icon" corrsespond to the window flag Qt::WindowMaximizeButtonHint

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

            @Gojir4 Found the definition of the icon - officially called "restore".
            It is assuming that the window was set maximize or minimize.
            Then it can be "restored".
            For yet unknown reason I cannot find how to build desired size of the dialog,
            only minimized or maximized.

            Since my code builds the area subwindow as minimized.
            I should be able to "restore" it in code.
            Thus I need to replace manually clicking on the "restore " icon and size the result.
            Not sure where - in dialog or area...

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              @AnneRanch said in adding subwindow to MDI area:

              Since my code builds the area subwindow as minimized.

              Well, don't do that then.

              default to "upper left corner of size the object "

              I do not know what this even means.

              If you want to position or resize the QMdiSubWindow then:

              • Capture the pointer to the QMdiSubWindow returned by QMdiArea::addSubWindow() (that your code line currently discards)
              • Then call QMdiSubWindow::resize() and/or QMdiSubWindow::move()
              A 1 Reply Last reply
              2
              • C ChrisW67

                @AnneRanch said in adding subwindow to MDI area:

                Since my code builds the area subwindow as minimized.

                Well, don't do that then.

                default to "upper left corner of size the object "

                I do not know what this even means.

                If you want to position or resize the QMdiSubWindow then:

                • Capture the pointer to the QMdiSubWindow returned by QMdiArea::addSubWindow() (that your code line currently discards)
                • Then call QMdiSubWindow::resize() and/or QMdiSubWindow::move()
                A Offline
                A Offline
                Anonymous_Banned275
                wrote on last edited by
                #7

                @ChrisW67 Before I read the last reply , I did this .
                Works as required

                   
                       Form_SYSTEM *FS = new  Form_SYSTEM();
                        
                        mdiArea->addSubWindow(FS)->
                                setWindowState(Qt::WindowMinimized) ;
                        //modify current / last addition 
                         mdiArea->currentSubWindow()->showNormal();
                         mdiArea->currentSubWindow()->resize(400,400);
                

                SOLVED

                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