[Qt-interest] How to force parent layout to recalculate when minimumSizeHint changes
Malyushytsky, Alex
alex at wai.com
Wed Feb 18 01:24:35 CET 2009
Try
void QWidget::updateGeometry ()
Notifies the layout system that this widget has changed and may need to change geometry.
Call this function if the sizeHint() or sizePolicy() have changed.
For explicitly hidden widgets, updateGeometry() is a no-op. The layout system will be notified as soon as the widget is shown.
Regards,
Alex Malyushytsky
-----Original Message-----
From: qt-interest-bounces at trolltech.com [mailto:qt-interest-bounces at trolltech.com] On Behalf Of Tony Rietwyk
Sent: Monday, February 16, 2009 6:42 PM
To: qt-interest at trolltech.com
Subject: [Qt-interest] How to force parent layout to recalculate when minimumSizeHint changes
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.
_______________________________________________
Qt-interest mailing list
Qt-interest at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-interest
---------------------------------------------------------------------------------------------------
Weidlinger Associates, Inc. made the following annotations.
"This message and any attachments are solely for the intended recipient and may contain confidential or privileged information. If you are not the intended recipient, any disclosure, copying, use, or distribution of the information included in this message and any attachments is prohibited. If you have received this communication in error, please notify us by reply e-mail and immediately and permanently delete this message and any attachments. Thank you."
"Please consider our environment before printing this email."
More information about the Qt-interest-old
mailing list