Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Windows scaling impact in Qt application and mainly on QFontMetrics
Forum Updated to NodeBB v4.3 + New Features

Windows scaling impact in Qt application and mainly on QFontMetrics

Scheduled Pinned Locked Moved Unsolved General and Desktop
1 Posts 1 Posters 205 Views 1 Watching
  • 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.
  • B Offline
    B Offline
    bb31
    wrote on last edited by
    #1

    Hello,

    I have several problems on my Qt application (developped with Qt 5.14.2) linked to Windows scaling.
    For example, I'm at 125% on my conputer and lines in table are too high, tabs in QTabWidget are also too high, but the main problem for me is that QFontMetrics.horizontalAdvance is really too wide (I use it to draw a selection rectangle around the text which is too wide).
    When I switch to 100%, everything is ok.

    I've looked at this page and, just before QApplication is created, I've added :

    QGuiApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
    

    But nothing changes.
    I've also tried to set environment variables as shown in the High DPI page but nothing changes.

    Do you have an idea on how I can correctly take into account Windows scaling to avoir these behaviours, mainly for QFontMetrics ?
    Do you think it's a Qt bug ?

    Thank you for your help.

    Baptiste

    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