PDA

View Full Version : Pushbutton sizing problem on Mac OS



will49
3rd October 2007, 18:43
I'm trying to make a series of 3 push buttons in a row 32x32 in size that have 16x16 icons inside them. In designer I have the geometry size set to 32x32, as well as the maximum and minimum sizes. All 3 are put inside a horizontal layout.

On Windows everything looks fine. Also when I preview in Qt Designer on a Mac everything looks fine.

However when I actually open the dialog in my app, the horizontal spacing of the icons is incorrect and they overlap as shown.

Any ideas on what is going wrong?

Attached image shows what is happening. I'm using Qt 4.3.1.

wysota
3rd October 2007, 18:50
Set a minimum size on the buttons to 32x32.

will49
3rd October 2007, 18:52
Already done that. I've set geometry, maximum and minimum sizes to 32.

It seems to maybe be a Mac specific thing. Same code works fine on Windows.

marcel
3rd October 2007, 18:54
Try adding a horizontal spacer at the right side of the buttons. And make sure you give them the correct minimum/maximum sizes.

And try to give the buttons more room, and see if that works. In that case, the container should be enlarged.

wysota
3rd October 2007, 19:11
Use tool buttons instead of pushbuttons. There is a high chance they'll be working as you expect it out of the box.

will49
3rd October 2007, 21:26
Using tool buttons instead worked great. Always best to use the right tools for the job I guess ;-)