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. [SOLVED] resizing a QMdiSubWindow

[SOLVED] resizing a QMdiSubWindow

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 3.4k Views
  • 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.
  • P Offline
    P Offline
    planarian
    wrote on last edited by
    #1

    So I have a widget with a minimal layout that allows me to resize its contents when I stretch the window. When I try to put this widget inside a QMdiSubWindow, the contents no longer resize (only the frame). If I apply a layout to the subwindow, I get a warning that it already has one. Although I know there's a way to delete the existing layout, I'd prefer not to since that presumably means I'd have to reimplement the minimize/restore buttons, etc. Is there a simpler way to achieve what I want?

    [EDIT: Thanks, Chris. Your assurance that the resizing ought to work "as is" prompted me to review my program more closely. It turns out that one of the subwidgets in the subwindow has to be destroyed and reconstructed, but my layout code wasn't taking that into account.]

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

      The behaviour you want is the default when you QMdiArea::addSubWindow() your widget directly or set your widget as the contained widget of a QMdiSubWindow before adding it. You'll need to post a minimal, compilable example that demonstrates your problem so we can see where you are coming unstuck.

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

        If you are removing/destroying and replacing widgets in a layout to switch between a couple of options you should consider QStackedWidget.

        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