[Qt-interest] When does a custom widget need a custom sizeHtin() ?
Sean Harmer
sean.harmer at maps-technology.com
Mon Dec 14 11:42:59 CET 2009
Hi Stephen,
On Monday 14 December 2009 10:30:38 Stephen Collyer wrote:
> I have created a custom widget derived from QWidget. It comprises two other
> standard Qt widgets arranged in a QLayout.
>
> Does this need a custom sizeHint() ?
>
> When does a custom widget require a custom sizeHint() ? Maybe when it's not
> a simple composition of widgets inside a QLayout ?
Yes I think that is correct or if you wish to customise the sizeHint behaviour
away from that provided by the layout and your contained widgets.
Easy way to try it is to put your custom widget into a layout and see if it
behaves as expected. If it does then great. If not then implement your own
custom sizeHint() function.
Good luck,
Sean
More information about the Qt-interest-old
mailing list