I create a widget with a vertical layout and a number of items.
If I put it in a MainWindow, everything goes right.
If I put it in a QDockWidget which I make floating, the items are shrinked as a function of their position in the layout (the bottom being schrinked more and the top ones being expanded).
Actually the whole widget seems not to get the right size, ie the sum of all its children sizes but is smaller.
Where is the problem?
Qt Code:
  1. QWidget *ww = new QWidget();
  2. dock->setWidget(ww);
  3. this->addDockWidget(Qt::TopDockWidgetArea, dock);
  4. dock->setFloating(true);
  5. QVBoxLayout *Layout = new QVBoxLayout();
  6. Layout->setMargin(LAYOUT_MARGIN);
  7. Layout->setSpacing(LAYOUT_MARGIN);
  8. ww->setLayout(Layout);
  9. ...
To copy to clipboard, switch view to plain text mode