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. QDockWidget sizing before and after moving
QtWS25 Last Chance

QDockWidget sizing before and after moving

Scheduled Pinned Locked Moved Solved General and Desktop
4 Posts 2 Posters 794 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
    KevNull
    wrote on last edited by
    #1

    I admit I'm confused.

    I have a program with subclassed QOpenGLWidgets inside QDockWidgets. The only size information these give out is a minimum size.

    I want to call setFeatures to lock them in place while a specific function runs, but this along with various other operations shrinks the dock areas down to the minimum size that will hold all the QDockWidgets. Presumably by calling adjustSize()

    If I manually undock any QDockWidget, including a dummy one I create for testing, and dock it again then this behaviour goes away, like adjustSize() is no longer called. I can resize the dock widgets to my heart's content and it keeps those sizes.

    My question is whether there's a way to change whatever this changes programmatically so that the dock areas no longer shrink? I've tried the usual commands to float and unfloat them.

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

      Replying to myself here. I needed to find a way to set QDockAreaLayoutItem::KeepSize which it turns out gets set every time you load the main window state from, say, a temporary variable you just saved it to the line before.

      Hacky but it works.

      1 Reply Last reply
      0
      • K KevNull

        I admit I'm confused.

        I have a program with subclassed QOpenGLWidgets inside QDockWidgets. The only size information these give out is a minimum size.

        I want to call setFeatures to lock them in place while a specific function runs, but this along with various other operations shrinks the dock areas down to the minimum size that will hold all the QDockWidgets. Presumably by calling adjustSize()

        If I manually undock any QDockWidget, including a dummy one I create for testing, and dock it again then this behaviour goes away, like adjustSize() is no longer called. I can resize the dock widgets to my heart's content and it keeps those sizes.

        My question is whether there's a way to change whatever this changes programmatically so that the dock areas no longer shrink? I've tried the usual commands to float and unfloat them.

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

        @KevNull Hi,

        Are you using Qt5.10 ? I think you met this bug https://bugreports.qt.io/browse/QTBUG-65592
        more info here: https://stackoverflow.com/questions/48119969/qdockwidget-splitter-jumps-when-qmainwindow-resized

        I 'm using this workaround in the MainWindow constructor (as suggested by stackoverlow thread):

        resizeDocks(QList<QDockWidget*>() << ui->myDockWidget, QList<int>() << 40 , Qt::Horizontal);
        
        K 1 Reply Last reply
        4
        • Gojir4G Gojir4

          @KevNull Hi,

          Are you using Qt5.10 ? I think you met this bug https://bugreports.qt.io/browse/QTBUG-65592
          more info here: https://stackoverflow.com/questions/48119969/qdockwidget-splitter-jumps-when-qmainwindow-resized

          I 'm using this workaround in the MainWindow constructor (as suggested by stackoverlow thread):

          resizeDocks(QList<QDockWidget*>() << ui->myDockWidget, QList<int>() << 40 , Qt::Horizontal);
          
          K Offline
          K Offline
          KevNull
          wrote on last edited by
          #4

          @Gojir4 Thanks for the bug reference. I've added it to my code documentation.

          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