Results 1 to 2 of 2

Thread: QMdiSubWindow maximizing problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2007
    Posts
    104
    Thanks
    22
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default QMdiSubWindow maximizing problem

    I want to show widgets in an mdi area..and when i maximized it, it passes borders of this area and filling all the are of the main window...I mean it should just fill the mdiarea borders - area just but not ..
    what can i do or what am i doing wrongly ?

    Qt Code:
    1. QMdiSubWindow* subWindow = mdiArea->addSubWindow(view,Qt::SubWindow);
    2. subWindow->setOption(QMdiSubWindow::RubberBandResize, true);
    3. subWindow->setOption(QMdiSubWindow::SubWindowOption::AllowOutsideAreaHorizontally, false);
    4. subWindow->setOption(QMdiSubWindow::SubWindowOption::AllowOutsideAreaVertically, false);
    5. subWindow->setAttribute(Qt::WA_DeleteOnClose);
    6. subWindow->showMaximized();
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: QMdiSubWindow maximizing problem

    That is how maximised MDI child windows have worked on Windows (and elsewhere) for a long time. If you don't want the MDI child maximised then don't maximise it. I guess you could determine the size of the MDI area viewport and set that on the child window after intercepting the window state change:
    When the window state changes, the widget receives a changeEvent() of type QEvent::WindowStateChange.
    I have not tried that though.


    BTW: AllowOutsideAreaHorizontally and AllowOutsideAreaVertically are both undocumented and marked "internal" in the relevant header file.

Similar Threads

  1. Replies: 5
    Last Post: 6th May 2011, 10:51
  2. Painting problem when QMdiSubWindow is moved over QGraphicsView
    By Jayakrishnan in forum Qt Programming
    Replies: 0
    Last Post: 19th February 2010, 07:51
  3. QMdiSubWindow problem with resized window
    By estanisgeyer in forum Qt Programming
    Replies: 2
    Last Post: 7th January 2008, 14:39
  4. Maximizing a widget
    By Max Yaffe in forum Qt Tools
    Replies: 3
    Last Post: 11th July 2007, 06:05
  5. maximizing own widget on parent
    By masoroso in forum Newbie
    Replies: 8
    Last Post: 21st April 2006, 17:12

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.