Can someone explain size hint, size policy, size constraint in QT?

Alston picture Alston · Dec 2, 2013 · Viewed 8.9k times · Source

Can anyone give a clear explain of these 3 concept? What's the difference and how to use them?

Answer

ratchet freak picture ratchet freak · Dec 2, 2013

size hint is the preferred size of the widget, layouts will try to keep it as close to this as possible.

size policy describes how the size may change when the preferred size cannot be used (can it stretch or shrink) see the QSizePolicy::Policy enum for a description of each.

size constraint are the maximumSize and minimumSize the widget can be.