Purpose of sizeHint() and minimumSizeHint() ? (solved)
-
What is the purpose of sizeHint() and minimumSizeHint() ?
I see it often in widget class
QSize LED ::sizeHint() const{
return QSize(diamX_ , diamY_);
}QSize LED ::minimumSizeHint() const {
return QSize(diamX_, diamY_);
} -
sizeHint : const QSize
This property holds the recommended size for the widget.minimumSizeHint : const QSize
This property holds the recommended minimum size for the widget. -
So which function takes precedence? sizeHint or minimumSizeHint
Or user have to explicitly call either function? -
hi
Both are used
When the widget is created the system uses sizeHint for how to big to make at start.
When the widget is resized ( by layout, by user dragging) the minimumSizeHint is used to
make sure it never becomes smaller than that.
1/4