tags:

views:

614

answers:

3

I've got a complex dialog, and it is full of whitespace and I can't shrink it. In Designer, it has lots of components that then get dynamically hidden, and a few which are dynamically added. I've added dumping of size policies, size hints, and minimum sizes, but still can't figure out why Qt won't let me drag it smaller.

There must be some tools or techniques for troubleshooting this.

Please share.

+2  A: 

I don't know of any tools for doing this, but I have managed it before by changing the palette of the different elements in the dialog, then looking at what is taking up more (or less) room than I expected, and focusing my investigation on those elements.

In a more general sense, make sure you've set the dialog to not be a fixed size. That bit me once as well.

Caleb Huitt - cjhuitt
A: 

Sounds like we could use the equivalent of Firebug's element and CSS metrics inspector modes. The hardest part of such a tool would be effectively figuring out and communicating why an individual layout policy was using or not using a given size value in a widget.

+1  A: 

It's hard to tell without seeing your layout, but I see a lot of resize problems like you describe due to using QGridLayout. The largest thing in a column or row, is going to determine the minimum width of that column. The same for a row.

If you are using QGridLayout, you might try making things span columns/rows.

I'd also recommend trying all your various layout configurations in Designer and test it by resizing. We don't actually use Designer where I work, but I use it all the time to test, and debug layout ideas.

Michael Bishop