2

I've designed a QDockWidget in Qt Creator. For some reasons it has a minimum size assigned (screenshot). I can change the size (e.g. to 0x0) and save the form, but whenever I reopen the form it is reset to 60x38 . All child widgets have a minimum size of 0x0 .

Even if I change the size in code (runtime) as here

QSize min(10, 10);
this->ui->qw_NavigatorDockWidgetOuter->setMinimumSize(min);
this->ui->fr_NavigatorDockWidgetInner->setMinimumSize(min);
this->setMinimumSize(min); // QDockWidget

I cannot resize the floating (!) widget below a 60 width. Where is that constraint coming from and how can I reduce the width?

QtCreator

Horst Walter
  • 13,663
  • 32
  • 126
  • 228

1 Answers1

2

Set both Horizontal and Verical sizePolicy to Ignored and you'll be able to modify the size down to the minimum you set.

Zlatomir
  • 6,964
  • 3
  • 26
  • 32
  • Good hint, unfortunately does not change anything for me. I have set "Ignored" to all relevant widgets in the GUI design editor and in code. The size constraint remains. – Horst Walter Apr 17 '15 at 15:29
  • Set it for the top level widget. – Zlatomir Apr 17 '15 at 15:44
  • What do you mean by top level widget? I have the QDockWidget, its child widgets, or the main window. I have set "Ignored" to QDockWidget and all child widgets. – Horst Walter Apr 17 '15 at 16:11