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. default style of 6.2 looks defect :(

default style of 6.2 looks defect :(

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 3 Posters 672 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.
  • D Offline
    D Offline
    django.Reinhard
    wrote on last edited by
    #1

    Hi,

    as I'm new to qt, I'm unsure about what is my mistake and what could be qt issue ...
    So I toggle between 5.15 and 6.2

    When I first compiled my app with 6.2 - I was shocked about the result:

    5.15
    6.2.0

    Just to make it clear: same source! Only different toolkit.

    Is there a chance to get the same look as 5.15 using 6.2?
    In codeeditor widget I set font and fontsize - so both should be the same.

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi

      alt text

      alt text

      Seems to be font scaling.

      Did you set the font size as point size or pixel size?

      In any case to check if this is due to auto scaling, try disable it in with
      Qt::AA_DisableHighDpiScaling
      https://doc.qt.io/qt-5/highdpi.html

      and see if they then look the same.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        django.Reinhard
        wrote on last edited by
        #3

        Hi,

        thanks for your attention!
        ... and thank you for importing the pictures :)

        @mrjj said in default style of 6.2 looks defect :(:

        Seems to be font scaling.

        Yes, but the strange thing: in my understanding should dpi settings/font scaling be handled by operating system, not by application.
        Font-settings of elements where I don't change font settings is disgusting. I didn't want to overwrite a whole stylesheet, but it looks like I have to ...

        So compiling an application with another toolkit version should imho not differ that much.
        The page you linked says, that high dpi support has been introduces in release 5.6 - so there should be no difference between 5.15 and 6.2

        @mrjj said in default style of 6.2 looks defect :(:

        try disable it in with
        Qt::AA_DisableHighDpiScaling

        I tried to change environment variable (it was already set to 0 by qtcreator), but it made no difference.

        mrjjM 1 Reply Last reply
        0
        • D django.Reinhard

          Hi,

          thanks for your attention!
          ... and thank you for importing the pictures :)

          @mrjj said in default style of 6.2 looks defect :(:

          Seems to be font scaling.

          Yes, but the strange thing: in my understanding should dpi settings/font scaling be handled by operating system, not by application.
          Font-settings of elements where I don't change font settings is disgusting. I didn't want to overwrite a whole stylesheet, but it looks like I have to ...

          So compiling an application with another toolkit version should imho not differ that much.
          The page you linked says, that high dpi support has been introduces in release 5.6 - so there should be no difference between 5.15 and 6.2

          @mrjj said in default style of 6.2 looks defect :(:

          try disable it in with
          Qt::AA_DisableHighDpiScaling

          I tried to change environment variable (it was already set to 0 by qtcreator), but it made no difference.

          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @django-Reinhard

          Hi
          Font scaling is mostly handled by the OS but Qt allows the app to tweak how it's applied.

          Normally you would add
          QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
          Before the app in main.cpp but as far as I know the env also works.

          I have to try with Qt6. I have not noticed any change. At least not on win 10

          D 1 Reply Last reply
          0
          • mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Hi

            I tried a default GUI app with some labels and other widgets on.
            I saw zero difference between 5.12 and 6.1

            So I wonder if you set fonts via stylesheets ?

            1 Reply Last reply
            0
            • C Offline
              C Offline
              ChrisW67
              wrote on last edited by
              #6

              I did not think there was "high-DPI" font scaling offered under Linux, or Qt on Linux (where this application appears to be running).

              This may be that the default font applied in whatever QStyle is being used has changed, and that the changed font does not exist in the runtime system. That will result in it being mapped to something else that might be sub-optimal.

              1 Reply Last reply
              0
              • D Offline
                D Offline
                django.Reinhard
                wrote on last edited by
                #7

                Hi,

                @mrjj said in default style of 6.2 looks defect :(:

                So I wonder if you set fonts via stylesheets ?

                No I don't

                @ChrisW67 said in default style of 6.2 looks defect :(:

                I did not think there was "high-DPI" font scaling offered under Linux, or Qt on Linux (where this application appears to be running).

                This may be that the default font applied in whatever QStyle is being used has changed, and that the changed font does not exist in the runtime system. That will result in it being mapped to something else that might be sub-optimal.

                That sounds reasonable! QStyle does I lot, I didn't get rid of yet.

                But that is no reason for the different size of the controls, where I manually set a font. That font is of cause in place ...
                So the only reason, that makes sense for me, is different dpi understanding/behaviour.

                @mrjj said in default style of 6.2 looks defect :(:

                Normally you would add
                QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
                Before the app in main.cpp but as far as I know the env also works.

                I'll try that.

                1 Reply Last reply
                0
                • mrjjM mrjj

                  @django-Reinhard

                  Hi
                  Font scaling is mostly handled by the OS but Qt allows the app to tweak how it's applied.

                  Normally you would add
                  QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
                  Before the app in main.cpp but as far as I know the env also works.

                  I have to try with Qt6. I have not noticed any change. At least not on win 10

                  D Offline
                  D Offline
                  django.Reinhard
                  wrote on last edited by
                  #8

                  @mrjj said in default style of 6.2 looks defect :(:

                  Normally you would add
                  QApplication::setAttribute(Qt::AA_DisableHighDpiScaling);
                  Before the app in main.cpp but as far as I know the env also works.

                  I couldn't try that before - so did the test right now - and it looks, that Qt6.2 does not have any attribute like "AA_DisableHighDpiScaling".
                  I got compiler errors, so I guess, environment variable can't work either.

                  I searched a bit for similar attributes and found "Qt::HighDpiScaleFactorRoundingPolicy::Ceil" - but using this attribute does not change anything.

                  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