Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Relative pixel size and component visualization different depending on OS or HW
Forum Updated to NodeBB v4.3 + New Features

Relative pixel size and component visualization different depending on OS or HW

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
qmlpixelqtcreator
2 Posts 1 Posters 632 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    prex
    wrote on last edited by
    #1

    I'm trying to develop a Qml application for an embedded system in Qt Creator. Since the screen size of the target system is always the same (Full HD), I decided to go for a fixed size application. To avoid any problems, I would really like to "define each physical pixel". I would also expect that the proportions stay the same since I have a Full HD screen. The application is defined accordingly with 1920x1080px and all the elements defined in pixel.

    However, first problem, a font with size 20px does not look the same on an Intel NUC and my custom hardware (they differ in the Linux Kernel). They don't use the same hardware, but both of them have a Full HD screen. So how can font size 20px be different on one system than on the other, if both live in a world of 1920x1080px in total? If pixel sizes are really different, then the window would also not fit the screen. And furthermore, if there is some scaling, this would be equally applied to any pixel, I assume.

    The same applies for the size and position of Qml components. They overlap each other on one system, while they're fine on the other system.

    I'm using a Material style, but even removing it does not solve this issue.

    Also, the positions in QtCreator do not correspond to either one of the realities. The .ui.qml is completely off, while the .qml is more or less accurate in positions except from not showing any Material style of the elements.

    This starts to get really annoying. I'm doing trial & error with blindly moving the elements millimeters, building for my embedded system (which takes quite a lot of time) and repeating this process for hours.

    1 Reply Last reply
    0
    • P Offline
      P Offline
      prex
      wrote on last edited by
      #2

      I checked out the ratio of the main frame on the embedded system, which is the same as on my desktop. The fixed pixel width and height of the main window are exactly the same.

      The high dpi scaling attribute has no influence. Also switching from font.pixelSize to font.pointSize has the same unwanted effect.

      How can the font proportions turn out different? If the main windows height is defined as 1080px, a font size of 20px must be clearly defined relative to it (1/54 of the main window height). But why does it take, let's say, 24px on my embedded system (which is 1/45)?

      I can find many posts about scaling, but what I want is no automatic, random scaling at all.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved