PDA

View Full Version : Porting a GUI designed in Windows to Mac



lynchkp
23rd April 2011, 18:13
Hello everyone,

I'm wondering what the best way to port the GUI of my Windows program to Mac would be. My program successfully builds and runs on both platforms, but on Mac, the GUI layout and font sizes are much different. I've seen some posts on Google that this is due to the Mac treatment of fonts at a 72 instead of 96 dpi. But is there a simple way to change all the font sizes or correct my layouts for Mac? Note, I'm not too worried about maintaining the Aqua "look and feel," this program is simply a utility I'm designing for my laboratory that needs to also run on a Mac.

I've attached a picture showing my Settings dialog, in which the layout breaks can be clearly seen.

Thanks for advice in advance!6284

Lykurg
23rd April 2011, 18:31
Do you use layouts? How does it come that the text overlaps the table? Can we see the ui file for that part.

lynchkp
23rd April 2011, 19:46
Hey Lykburg,

I use layouts within my group boxes. In windows, the text does not overlap the table whatsoever. This is part of the issue with the Mac port.

My .ui file was too large to directly attach to the post, so I uploaded it to my webserver:

http://www.kplynch.com/settingsdialog.ui

Thanks!

Lykurg
23rd April 2011, 20:19
Well, you don't use layouts. That's what I've guessed. Using them partially doesn't help very much because then the container are still positioned absolute and you cant grow or shrink the window. Have a look at the docs on how to use layouts.

I have modified the first page of the stacked widget that you can imagine how it is done (it is not perfect, since you have put everywhere min and max sizes and I am too lazy to remove them all...): 6285. As a side node to your table: you should consider to move the descriptive row text to the header view of the table.

Best,

Lykurg

lynchkp
23rd April 2011, 20:35
Thanks a bunch. Obviously I'm going to have to learn a bit more about layouts. The UI file you attached was very informative.