Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6568103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:24:57+00:00 2026-05-25T14:24:57+00:00

Coming from a Web Development background I am now into QT Applications development. Working

  • 0

Coming from a Web Development background I am now into QT Applications development.

Working with QFonts I have seen that I have only two options apparently, to define fonts sizes in QT; either by pixel size, or point size.

When making web layouts I am used to define all my fonts in a relative way… using em units which refer to the inherited font size, where 1em equals the font-size of the container element, 0.5em 50% the font-size, 1.5em 50% bigger, and so on.

I am worried about portability and device/OS idenpendence of my applications. Is there any better way to define these fonts or should I instead stick to one of these methods?
If possible, can I inherit font-sizes and define sizes in relative units such as ems or percentages?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:24:58+00:00Added an answer on May 25, 2026 at 2:24 pm

    Depending on how you design your application, I’m afraid that as well as worrying about font size, you will also need to be very careful about platform-specific fonts.

    For example, I’ve just run Qt Designer, inside Qt Creator 2.3.0 (Based on Qt 4.7.4) – so pretty much the latest stable code, and done the following:

    • Created a new Qt Designer form (i.e. a .ui file)
    • Made it an empty Widget
    • Added a QTextEdit (this is called “Text Edit” in Designer’s “Input Widgets” section)
    • Double-clicked on the QTextEdit, to open its properties
    • Viewed its Source

    This is what I see:

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
    <html><head><meta name="qrichtext" content="1" /><style type="text/css">
    p, li { white-space: pre-wrap; }
    </style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:7.8pt; font-weight:400; font-style:normal;">
    <p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"></p></body></html>
    

    Note the use of Windows-specific font, and a very hard-coded size, before I’ve even made any changes to the content: font-family:'MS Shell Dlg 2'; font-size:7.8pt;

    I’ve previously reported this to Qt’s user support, and been told (via the status of the bug) that there there are no plans to fix it. (See Edit below, for info on these bugs)

    So at work, every release, we have to search through all our .ui files, to make sure that no platform-specific font info has crept in to any .ui file since the previous release.

    (A year or two ago, I ran Designer on each of Mac, Windows and Linux, and showed that each version generated its own platform-specific font info like this, and very different default font sizes. Each failed to display correctly on the other two platforms! The Mac text was way too large on the other two, and the other two were way too small on the Mac)

    I really like Qt a lot, but I find this lack of platform independence in something so basic as its UI designer rather frustrating.

    Edit – bug info from TrollTech, July 2009

    I’ve found the info from when I reported ‘.ui cross-platform problems – portability of fonts and sizes’. I don’t know how these old references numbers, from TrollTech in July 2009, translate to current Qt issue-tracking: I’m hoping someone else might be able to update the links, to current working ones:

    • TrollTech support ticket: N258723
    • Want to specify relative sizes for QLabels, with using platform-specific fixed sizes:
      • [broken link] http://www.trolltech.com/developer/task-tracker/index_html?method=entry&id=241089
    • How can we stop Qt Designer putting in platform-specific font names and font sizes in future?
      • [broken link] http://www.qtsoftware.com/developer/task-tracker/index_html?method=entry&id=153335
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm coming from a web-development background and I am wondering how I would make
I am new to web programming, coming from a video game development background (c++),
I'm making my way into web development and have seen the word postback thrown
I'm new to iPhone development, coming from a web application development background and I'm
I'm pretty new to mac development (coming from a web and iOS background) and
Coming from web development I have been trying to get familiar with compiled programming,
I am trying to learn web development using Mono. Coming from ASP.NET background, I
I recently got interested in web development coming from kernel based applications. I am
I'm coming to iOS development from a web dev background. Having all of my
Coming from a background, I'm familiar with GUI editors that do a poor job

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.