Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct


    Qt World Summit: Early-Bird Tickets

    Unsolved Windows scaling impact in Qt application and mainly on QFontMetrics

    General and Desktop
    1
    1
    71
    Loading More Posts
    • 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
      bb31 last edited by

      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 Reply Quote 0
      • First post
        Last post