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

DockWidgets do not respect the sizeHint if the child widget is a QWindow set with createWindowContainer

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.1.1
    • Widgets: Layout
    • None
    • Windows 7-64
      VS 2010 x86
      Qt 5.1.1

    Description

      "Custom size hints, minimum and maximum sizes and size policies should be implemented in the child widget. QDockWidget will respect them, adjusting its own constraints to include the frame and title." (From the Qt 5.1 documentation of QDockWidget)
      If the child widget is a window container created by createWindowContainer which holds a QWindow (e.g. a QGLView) the sizeHint of the QWindow will not be respected. CreateWindowContainer creates a QWindowContainer which is completely private so there is no opportunity to set the sizeHint in this class. Therefore I would expect, that the size hint of the contained QWindow would be respected, but this is not the case.

      Pseudocode to reproduce the problem:

      class CMyWindow : public QWindow
      {
      public:
      virtual QSize sizeHint() const

      { return QSize(400,300); }

      ;
      };

      QDockWidget *pDockWidget = new QDockWidget();
      CMyWindow *pWindow = new CMyWindow();
      QWidget *pContainer = createWindowContainer(pWindow);
      pDockWidget->setWidget(pContainer);
      pDockWidget->show();

      Attachments

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              ibdm Donald Marotzke
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes