PDA

View Full Version : Window resize problem on Windows XP



smacchia
13th January 2010, 18:01
I'm having difficulty getting a window to resize smaller than 125 pixels in width on Windows XP. I'm trying to build a control panel and want to allow the user to collapse it to a minimum width.

When the user presses the collapse "button" (really a label), a slot in the window gets called in which all widgets are hidden, except the collapse "button". On Linux this is all I need to do to get the bar to resize to a minimum width of, around 30 pixels. But on windows it doesn't change size at all. I added calls to resize in the slot and still no reduction in width on windows.

I've attached an example. If my min/max widths are bigger, than calling resize in the slot works (it must be called to affect a change in width on Windows). The example doesn't include bigger min/max widths, but I tried this out to see if I could find the culprit.

Any help here would be greatly appreciated. I'd hate to have to revert to having 2 windows - one in a collapsed state and one not, which I could alternately hide/show...

Thanks in advance.

P.S. Using Qt 4.6.0

smacchia
15th January 2010, 15:04
In this example, the resize() method doesn't behave correctly on Windows. Using QWidget::adjustSize does the trick.