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

When setFixedWidth() is used for a QDockWidget it is impossible to change the height of the dock widget when docked

    XMLWordPrintable

Details

    Description

      When setFixedWidth() (setFixedHeight) is used for a QDockWidget, the vertical (horizontal) size cannot be changed in the dock state. The splitter handle is not available.

      Example to reproduce: Modify Qt example
      $QTDIR/examples/mainwindows/dockwidgets/mainwindow.cpp

      void MainWindow::createDockWindows() 
      { 
      .... 
      
      customerList->addItems(QStringList() 
      << "John Doe, Harmony Enterprises, 12 Lakeside, Ambleton" 
      << "Jane Doe, Memorabilia, 23 Watersedge, Beaton" 
      << "Tammy Shea, Tiblanka, 38 Sea Views, Carlton" 
      << "Tim Sheen, Caraba Gifts, 48 Ocean Way, Deal" 
      << "Sol Harvey, Chicos Coffee, 53 New Springs, Eccleston" 
      << "Sally Hobart, Tiroli Tea, 67 Long River, Fedula"); 
      
      /* add this line */ 
      customerList->setFixedWidth(300); 
      
      dock->setWidget(customerList); 
      
      .... 
      } 
      
      

      Result:
      The splitter cannot be grabbed between "Customers" and "Paragraphs

      Expected:
      It should be possible to resize the docked widget height with the splitter

      Regression:
      Between 4.5.3 and 4.6.0 from commit 308ed3913b406c43dfdab4fa734a332863dc4cbc

      Suggested patch:

      diff --git a/src/gui/widgets/qdockarealayout.cpp b/src/gui/widgets/qdockarealayout.cpp
      index e8fa6d8..e42cf2f 100644
      --- a/src/gui/widgets/qdockarealayout.cpp
      +++ b/src/gui/widgets/qdockarealayout.cpp
      @@ -157,7 +157,7 @@ QSize QDockAreaLayoutItem::maximumSize() const
      
       bool QDockAreaLayoutItem::hasFixedSize(Qt::Orientation o) const
       {
      -    return perp(o, minimumSize()) == perp(o, maximumSize());
      +    return pick(o, minimumSize()) == pick(o, maximumSize());
       }
      
       bool QDockAreaLayoutItem::expansive(Qt::Orientation o) const
      
      

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            sanonymous Nokia Qt Support (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes