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 manually set size of docking area?
Qt 6.11 is out! See what's new in the release blog

How to manually set size of docking area?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 960 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.
  • K Offline
    K Offline
    kitfox
    wrote on last edited by
    #1

    I'm writing an editor in Qt and have created an MDI style interface that allows the user to open multiple views, resize them and dock them to the sides or bottom of the main window as they see fit. I'd like to have the program automatically save and restore the user's layout whenever the program closes.

    I can step through all my windows and save their size, position, visibility and so on, but I can figure out how to restore with width of a docking region. Even if I call QDockWidget::resize(), the docking area still shrinks to the default starting size. This happens whether I call resize before or after I add it to the dock.

    How do I programmatically adjust this region?

    1 Reply Last reply
    0
    • K Offline
      K Offline
      kitfox
      wrote on last edited by
      #2

      Looks like QMainWindow has saveState() and restoreState() methods that I can use to preserve the state.

      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