[Qt-interest] How to force parent layout to recalculate when minimumSizeHint changes

Tony Rietwyk tony.rietwyk at rightsoft.com.au
Tue Feb 17 03:42:05 CET 2009


Hi Everybody, 

I have a widget that is derived from QFrame.  The minimumSizeHint method depends on a property that can be set in QtDesigner.  When the property value changes, the widget does not change to reflect the new value for the size hint.  How can I force the parent's layout to recalculate when the property changes?  I tried adjustSize, but it doesn't work: 


QSize TChordFrame::minimumSizeHint() const
{
	if (FJazz)
		return QSize( ANSWER_BOX_WIDTH_JAZZ, ANSWER_BOX_HEIGHT_JAZZ );
	else
		return QSize( ANSWER_BOX_WIDTH_FB, ANSWER_BOX_HEIGHT_FB );
}

void TChordFrame::setJazz(bool value)	// Property setter
{
	FJazz = value;
	adjustSize();
	repaint();
}


Thanks in advance! 

Tony.





More information about the Qt-interest-old mailing list