Results 1 to 20 of 40

Thread: Platform independent GUI

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2008
    Posts
    155
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Platform independent GUI

    I am sure this question must have been handled may times, but I have not found any answer in the forum.

    What is the best way to get a platform independent GUI regarding font size, if you have a lack of real estate?
    If I design by Windows Designer the Mac GUI will show label and button fonts too big to suit my layout, and vice versa if I design on Mac they will be too small if I view the resulting GUI on Windows.
    Also, i.e. Arial 12 does not have the same size, on Windows it is really big, on Mac it is small.
    Is there any font that will have a platform independent size?

    Any hints for a strategy?
    Except having completely different ui files for Mac and Windows, which will be a mess to maintain.

    BN
    MacOSX user dabbling with Linux and Windows.

  2. #2

    Default Re: Platform independent GUI

    Very often interesting question has no answer, i'm investigating for the same issue...

  3. #3
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Platform independent GUI

    Qt uses sensible defaults so if you don't modify the fonts in the ui files from their defaults, the output should look sensible on all platforms.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4

    Default Re: Platform independent GUI

    It's not exactly like this.
    On Windows if you put in the designer a label on a widget it takes
    , by default, point size 8 and Ms Shell Dlg 2 and the surrounding rect has about width 46 , height 14 with text "TextLabel".
    On Mac the same label, by default, has point size 13 and Lucida Grande and the surrounding rect has about width 61 height 17.
    So it looks quite different and using the defaults does not solve the problem.
    Besides, if on Windows you set the font size to , for example, 11 it renders of course quite bigger than 8 on Windows but on Mac where the default is 13 it renders still smaller!!!.

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Platform independent GUI

    Quote Originally Posted by nakkore View Post
    It's not exactly like this.
    On Windows if you put in the designer a label on a widget it takes
    , by default, point size 8 and Ms Shell Dlg 2 and the surrounding rect has about width 46 , height 14 with text "TextLabel".
    On Mac the same label, by default, has point size 13 and Lucida Grande and the surrounding rect has about width 61 height 17.
    So it looks quite different and using the defaults does not solve the problem.
    Besides, if on Windows you set the font size to , for example, 11 it renders of course quite bigger than 8 on Windows but on Mac where the default is 13 it renders still smaller!!!.
    I didn't say the size in milimetres (or any other unit) would be the same. I said it will look sensibly alright on all platforms, not the same on all platforms (and resolutions). You can change the defaults for each of the platform by manipulating configuration files, if you need that. Run the qtconfig program if you have it and play with it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6

    Default Re: Platform independent GUI

    Wysota,
    i can understand your point of view about "sensibly alright" but to deliver the application it's not enough and if you do not face the problem directly it's not enough say "use qtconfig"..
    to do what ? if i use qtconfig to alter the defaults (but anyway i do not want to change defaults) all qt applications change their defaults isn't it ? i just want my application handles fonts in a consistent way across platforms so that it's not necessary to hack the code or the ui to obtain these results. This was the initial question that still has no answer.

  7. #7
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Platform independent GUI

    If you don't want to change the system defaults then don't. Modify font settings for your application and that's it (QApplication::setFont()). I really don't see the problem
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  8. #8
    Join Date
    Jul 2007
    Location
    California, USA
    Posts
    62
    Thanks
    17
    Thanked 7 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Platform independent GUI

    I think the issue here is that what people (including myself) are trying to do if to find a font and size that will look the same across platforms. I am applying stylesheets to get my look and feel and, as part of that, I have to set a font and size. I agree that arial 12 looks very different on mac and windows. In addition there are quirks using Arial. For example, the word "down" on windows looks fine but on mac looks like "dow n". Users on mac assume that this is a typo when it isn't.

    Has anyone found a font and size that looks the same (or at least really close) across platforms?

  9. #9
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Platform independent GUI

    Quote Originally Posted by ntp View Post
    Has anyone found a font and size that looks the same (or at least really close) across platforms?
    That's not enough. If a user has poor eye-sight and increased the font size in system settings to let's say 24px and you force a 12px font in your application I assure you the user won't be satisfied regardless of the platform and font family. If you're interested in your users feeling good with your application, force as few things as possible - let the user choose the font he likes best, not the one you like best.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  10. #10
    Join Date
    Nov 2009
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Platform independent GUI

    I agree, but then why can I not find a way to set a default label font size in Qt Designer, for example?

  11. #11
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Platform independent GUI

    Because the default label font is QApplication::font().
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  12. #12
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Re: Platform independent GUI

    Quote Originally Posted by wysota View Post
    That's not enough. If a user has poor eye-sight and increased the font size in system settings to let's say 24px and you force a 12px font in your application I assure you the user won't be satisfied regardless of the platform and font family. If you're interested in your users feeling good with your application, force as few things as possible - let the user choose the font he likes best, not the one you like best.
    That's a point, but I wouldn't say that's the single best option.
    From my perspective, letting the user dictate the graphical behavior of an app can be a double edged sword, since it might be a trade-off between clarity and ergonomic.

    That philosophy comes from the received idea that the OS should dictate the look and feel of an application. As a result many apps are still using some old rusty OS specific widgets while the web apps uses CSS, vectorial graphics and makes us look last century.

    If you let the user control the look and feel, you're giving him a tool for messing up the whole user experience.
    If a "forced" graphic choice is made for the sake of simplicity and ergonomic it's a good choice.

  13. #13
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Platform independent GUI

    Quote Originally Posted by bunjee View Post
    From my perspective, letting the user dictate the graphical behavior of an app can be a double edged sword, since it might be a trade-off between clarity and ergonomic.
    That's the user's choice, don't you think?

    That philosophy comes from the received idea that the OS should dictate the look and feel of an application. As a result many apps are still using some old rusty OS specific widgets while the web apps uses CSS, vectorial graphics and makes us look last century.
    ...thus upgrading the way the OS draws those rusty widgets will upgrade the looks of all applications. Do you think web browsers shouldn't have a default font and default styles set up? If you had to do everything from scratch and at the same time embed some application into another (like a google gadget into a webpage) the embedded part would stand out which probably wouldn't look good. You need to have standards and you need to obey them. If the standards are old - upgrade the standards instead of abandoning them.

    If you let the user control the look and feel, you're giving him a tool for messing up the whole user experience.
    If a "forced" graphic choice is made for the sake of simplicity and ergonomic it's a good choice.
    You are contradicting yourself. Forced graphic choice would mean no CSS (i.e. the producer of a web browser says "all webpages should look like this for sake of simplicity and ergonomy") and yet you say we should use CSS to get rid of old rusty graphics. My opinion is that you should always find a "golden division" - so that both sides are satisfied. Otherwise you would ruin a fragile balance. If you allow too many changes, you may frighten your users but if you limit the changes too much, you may reduce your target audience. So why not have two modes - simplified (or default) where everything is set up the way the author likes and advanced (or customized) when it is set up the way the user likes.

    Can you honestly say you know what is best for all of your potential users? There is a company in Redmond that used to act like that...
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  14. #14
    Join Date
    Nov 2009
    Posts
    3
    Thanks
    1

    Default Re: Platform independent GUI

    Quote Originally Posted by bnilsson View Post
    I am sure this question must have been handled may times, but I have not found any answer in the forum.

    What is the best way to get a platform independent GUI regarding font size, if you have a lack of real estate?
    If I design by Windows Designer the Mac GUI will show label and button fonts too big to suit my layout, and vice versa if I design on Mac they will be too small if I view the resulting GUI on Windows.
    Also, i.e. Arial 12 does not have the same size, on Windows it is really big, on Mac it is small.
    Is there any font that will have a platform independent size?

    Any hints for a strategy?
    Except having completely different ui files for Mac and Windows, which will be a mess to maintain.

    BN
    Why not using images or pixmaps with text?, or font metrics, I didn't use it but maybe it could help you.

Similar Threads

  1. Replies: 3
    Last Post: 16th June 2009, 08:04
  2. QT Creator, cross platform program.
    By kazek3018 in forum Newbie
    Replies: 8
    Last Post: 20th December 2008, 23:13
  3. Cannot configure -platform win32-msvc2008, no nmake.exe
    By Jason Hamilton in forum Installation and Deployment
    Replies: 3
    Last Post: 1st September 2008, 10:05
  4. Replies: 3
    Last Post: 4th February 2008, 19:28
  5. Crash handler on Win32
    By niko in forum Qt Programming
    Replies: 3
    Last Post: 12th November 2007, 19:41

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.