1

I have a QWidget expanding to fit QMainWindow. I can dock a QDockWidget, but only if it fits to the current QMainWindow size.

I'd like to be able to drop the QDockWidget even if the QMainWindow is too small, and in that case resize it to accommodate the widget.

Is it possible?

Edit from comments:

when I drag the widget onto the main window, and the window is too small for the widget to fit in, it won't dock. So, I can't use QDockWidget signal topLevelChanged(bool) which is emitted when a QDickWidget is docked or undocked. signal.

J. Chomel
  • 8,193
  • 15
  • 41
  • 69
monoik
  • 13
  • 4
  • I didn't understand your question completely, but if you need to resize your `QMainWindow` when you dock/undock your `QDockWidget`, you can use `QDockWidget` signal `topLevelChanged(bool)`. It is emitted when a `QDickWidget` is docked or undocked. – hank Jul 13 '12 at 07:05
  • Thanks for your comment, Hank. Unfortunately when I drag the widget onto the main window, and the window is too small for the widget to fit in, it won't dock. So, I can't use this signal. – monoik Jul 13 '12 at 11:30
  • 4
    On the bright side, `QDickWidget` is one of my favorite SO typos ever. – FeRD Mar 20 '18 at 18:20

0 Answers0