[Qt-interest] widget in dockwidget do not get resized

Yifei Li yifli at mtu.edu
Thu Nov 3 21:11:39 CET 2011



On Nov 3, 2011, at 2:52 PM, Andre Somers wrote:

> Op 3-11-2011 19:29, Yifei Li schreef:
>> Hi all,
>> 
>> I did two experiments:
>> 
>> 1) add a QTextEdit directly to a QDockWidget, and the QTexEdit gets resized whenever its containing dock widget is resized
>> 
>> 2) However, if I put a QTextEdit in a layout which is set to be the layout of some other  QWidget W, and then add the QWidget W to the dock widget, the widget W is not resized when I resize the dockwidget
>> 
>> What should I do to make the widget W's change its size when the dock widget is resized?
>> 
> Make sure that widget W is in a layout itself,
You can't set a layout for a QDockWidget, although setLayout method exists for QDockWidget.
I have tried this, 
1) set a layout for QDockWidget
2) add widgets to the layout
3) NOTHING shows up in the QDockWidget

I don't understand why.



> and that you set this as 
> the layout manager for your QDockWidget. Remember: every widget needs to 
> be _in_ a layout, and every layout needs to be set _on_ another layout 
> or on a widget.
> 
> André
> 
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at qt.nokia.com
> http://lists.qt.nokia.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list