[Qt-interest] Squeezing/Shrinking widgets after removing children
Daniel Albuschat
d.albuschat at gmail.com
Thu Aug 13 17:15:52 CEST 2009
Hi there,
you can resize a widget to it's minimum required size by calling
resize(0, 0). I noticed, however, that, right after removing a widget
from it, the widget is not updated and the following call to resize(0,
0) resizes the widget to the size *including* the previously removed
widget. I guess that's because the actual removing only happens when
the event queue is processed.
I've created a blog-post with a detailed explanation and test-case here:
http://daniel-albuschat.blogspot.com/2009/08/shrinking-qt-widgets-to-minimum-needed.html
Is this correct? Is there some cleaner way around this than
QTimer::singleShot() or QApplication::processEvents()?
I find this pretty awkward and stumbled upon this problem a lot in the
past, but usually just avoided it by doing something different.
Regards,
Daniel Albuschat
--
eat(this); // delicious suicide
More information about the Qt-interest-old
mailing list