Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-41068

QDockWidget cannot be drag-resized when is has its minimum and maximum width set to the same value and a widget set

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.3.1, 5.4.0
    • None
    • Windows 7, Qt 5.4.0, Qt 5.3.1, MinGW 4.9.1, MinGW 4.8.2

    Description

      The bug appears when you create and dock two QDockWidets on the same side of QMainWindow. The upper one has to have its minimum and maximum size set to the same value and has a custom widget set via setWidget(QWidget *) method. This could be a default-constructed QWidget. The lower QDockWidget can be just a simple default-constructed instance.

      When you do this, the drag-resize icons, neither vertical nor horizontal, do not appear. If you change the order and place the normal QDockWidget on top, vertical drag-resizing becomes possible, but horizontal doesn't.

      Still, you should be able to resize the widgets no matter what the order is.

      When the custom widget is not set or width limits are not set to the same value, the bug doesn't appear.

      Here is the minimal code for QMainWindow.

      QDockWidget *limitedWidthDockWidget = new QDockWidget(this);
      limitedWidthDockWidget->setMinimumWidth(200);
      limitedWidthDockWidget->setMaximumWidth(200);
      
      QWidget *widget = new QWidget(limitedWidthDockWidget);
      limitedWidthDockWidget->setWidget(widget);
      
      QDockWidget *normalDockWidget = new QDockWidget(this);
      
      addDockWidget(Qt::RightDockWidgetArea, limitedWidthDockWidget);
      addDockWidget(Qt::RightDockWidgetArea, normalDockWidget);
      

      Reproduction steps for vertical resize case in the attached project are as follows.

      1. Run the qtbug41068_dockresizebug.zip project.
      2. Move the mouse cursor between the QDockWidgets.
      3. Try to drag-resize them.
        Expected: you can freely resize the widgets vertically.
        Actual: drag-resize icon doesn't appear and you are unable to resize.

      Horizontal resize bug also appears in the project.

      1. Run the qtbug41068_dockresizebug.zip project.
      2. Move the mouse cursor over the left side of either widget
      3. Try to drag-resize them.
        Expected: you can resize the widgets horizontally as long as width is equal or greater than upper widget's minimal width. The lower widget resizes freely and the upper one stays at the same size, creating empty space on the right side when width is extended.
        Actual: drag-resize icon doesn't appear and you are unable to resize.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            peppe Giuseppe D'Angelo
            idadru Karma
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes