Results 1 to 4 of 4

Thread: MDISubWindow will not resize

  1. #1
    Join Date
    Jun 2007
    Location
    Louisiana
    Posts
    77
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default MDISubWindow will not resize

    I have created several MDISubWindow(s) in an MDIArea. All windows appear in tiled format as requested but none will resize or move with code. I have tried to resize and move from code in each window and by code from the MDI MainWindow. The only thing that seems to effect size is setFixedSize() and setMinimumSize().

    How can I resize and/or move a MDIChild/MDISubWindw window? What is preventing the MDISubWindow from being resized or moved by the code in that window or from the MDI MainWindow?

  2. #2
    Join Date
    Dec 2008
    Location
    France
    Posts
    93
    Thanked 23 Times in 22 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android

    Default Re: MDISubWindow will not resize

    I remember i lost some time with that too, it was a long time ago when I used QWorkspace instead of QMdiArea. Try something like this :
    Qt Code:
    1. mdi_Widget->parentWidget()->setGeometry(...)
    To copy to clipboard, switch view to plain text mode 
    Replace setGeometry() by other functions you need to call.

    I found that in the QWorkspace documentation (complete description) but it works with the MdiArea too.

  3. #3
    Join Date
    Jun 2007
    Location
    Louisiana
    Posts
    77
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MDISubWindow will not resize

    Thank you for your suggestion. I did find the reference in QWorkspace you mentioned. I changed the program to perform the resize on the parentWidget(). It did produce some result. I can now resize the MDISubWindow from the MDI Mainwindow. However, here is a strange phenomenon. You cannot specify a layout strategy like tileSubWindow() or cascadeSubWindow() to do it. If either is specified it will not work.

    I still have not been able to make the move() work. I am trying to restore all MDISubWindow children to the same place and size as they were last. Settings will store the size and position correctly but there is still the problem of moving once they are initially created and the size and pos are recalled from the settings.

  4. #4
    Join Date
    Jun 2007
    Location
    Louisiana
    Posts
    77
    Thanks
    1
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: MDISubWindow will not resize

    I have discovered a couple of things of interest.

    1) An internal widget can be proportioned to be larger than the viewport area of a MDISubWindow. When this happens, the x() and y() values are not reliable.

    2) the parentWidget() must be used even in the code for each MDISubWindow when referencing the window geometry.

    3) the moveEvent does not fire on a simple move. It does get called when a resize moves the 0,0 corner of the MDISubWindow from it's original position.

    I am trying to find a reason for this but still come up blank. Anyone have ideas?

Similar Threads

  1. Replies: 1
    Last Post: 10th August 2008, 18:55
  2. Replies: 2
    Last Post: 22nd January 2008, 16:10
  3. QGraphicsScene / QGraphicsView speed after resize
    By themolecule in forum Qt Programming
    Replies: 1
    Last Post: 21st July 2007, 23:46
  4. Custom Shape Widget (resize)
    By PiXeL16 in forum Qt Programming
    Replies: 7
    Last Post: 12th February 2007, 07:00
  5. postponing resize event
    By Honestmath in forum Qt Programming
    Replies: 11
    Last Post: 26th February 2006, 00:32

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.