I’ve got some QDialog subclasses that were designed on Windows and which are now being ported over to Mac OS X. The problem is that the default font on Mac OS X appears to be much bigger, so the dialogs look quite cramped.
What’s the best way of making the dialogs bigger on Mac OS X than on Windows? (The size must remain fixed on each platform and they must look native.)
An example is the dialogs in Perforce’s P4V.
Thanks.
I had the same problem when porting from Win32 to Mac OS X, especially with:
a) Buttons: Their height (in pixels) has to be different in order to look the same.
b) Labels: The font-size (in points) has to be different in order to look the same.
I tried to create an -as possible- generic solution, following these rules:
I performed all form and widget layout editing ONLY in one environment (Windows XP) and transfered the source to other (OS X) only for compilation & test.
I created a generic OS-Dependend function to modify Button Height and Label’s font-size at runtime (see bellow) and I called this function from every custom dialog constructor, after setupUI() like this:
someDialog::someDialog(QWidget *parent) : QDialog(parent)
{
setupUi(this);
genAdjustWidgetAppearanceToOS(this);
// …
}
I introduced an exception list in genAdjustWidgetAppearanceToOS(this) function,
and put in it the names of all controls that I will not want to affect (nothing is perfect).
Here it’s my generic function to check and see if it can be of any help to you:
(!remember to modify at least the “DoNotAffect” list and append your labels/buttons names)