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

  • Home
  • SEARCH
  • 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 542431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T10:26:46+00:00 2026-05-13T10:26:46+00:00

Designing UIs with QtCreator under Windows, and porting the same .ui file under MacOSX

  • 0

Designing UIs with QtCreator under Windows, and porting the same .ui file under MacOSX leads to designs with some text parts very small — actually, the HTML ones. It seems it comes from the fact that QtCreator uses pt instead of px as text size unit, and that the default screen resolutions are quite different under Windows and MacOSX.

Is there any reason I didn’t come to more consistent results? Apart from editing each pt into px, are there any workaround?

Thanks.

  • 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-13T10:26:46+00:00Added an answer on May 13, 2026 at 10:26 am

    As a rule of thumb you should not specify the font sizes for controls manually in Qt Designer/Creator as this leads to the prolems you have. The reason for inconsistency is the fact that different platforms use different DPI settings (96 dpi on Windows vs. 72 DPI on Mac OS X).
    This results in fonts being displayed with different sizes.

    Also, you mentioned HTML. I assume you have set some HTML text in a QTextEdit-like widget using the built-in editor. When you select a font size there, Qt Creator will produce some HTML like this:

    <!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:'Sans'; font-size:11pt; font-weight:400; font-style:normal;">
    <p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Hello World</p></body></html>

    As you can see, it sets some font-size attributes, which is really nasty. A simple, easy solution to this desaster is to remove the style= attributes entirely. This causes the QTextEdit to use the default application font instead (which should be fine on all platforms):

    <html><head></head><body><p>Hello World</p></body></html>

    As a sidenote, this is much friendlier for translators, as they don’t have to fight through all the useless CSS.

    Unfortunately Qt’s QTextEdit does not support the “percent” font-size specification (just px and pt). If it did, you could have used something like “90%” to make the text smaller than the default font while still being on the safe side.

    Another option would be a QWebView, which you make editable. This allows for good text formatting while having the full CSS subset. But that might be overkill.

    Hope that helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 312k
  • Answers 312k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Change the FormBorderStyle to a fixed one, depends what look… May 13, 2026 at 10:35 pm
  • Editorial Team
    Editorial Team added an answer Found the problem. It's a bug in Mechanize HTML parser… May 13, 2026 at 10:35 pm
  • Editorial Team
    Editorial Team added an answer I posted this question to comp.lang.c++.moderated. Daniel Krügler of the… May 13, 2026 at 10:35 pm

Related Questions

Long story short: I've been layout out UI's with Html/CSS for about 8 years
I'm looking for some arguments to pitch to my boss and fellow developers. We're
I have two tables in my database: Company table (ID, CompanyName, CompanyUsername, CompanyPassword) Employee
I have to choose a platform for our product. I have to decide between
Are there any good resources (books, authoritative guides, etc.) for design patterns or other

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.