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

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

      "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();

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

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

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes