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. GUI font sizing issues on different Windows versions
QtWS25 Last Chance

GUI font sizing issues on different Windows versions

Scheduled Pinned Locked Moved General and Desktop
7 Posts 2 Posters 1.6k 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.
  • F Flavio Mesquita

    @mrjj Thanks for the answer, that is what I like about this community, u guys are always willing to help noobs like me. I did what u pointed , it works fine, still gives a warning like below, but it works. Thank u very much.

    C:\Users\Flavio\Documents\qtTest\interface2_v2\main.cpp:9: warning: label 'read' defined but not used [-Wunused-label]
    read:(":/logo/uff.png");
    ^

    m4l490nM Offline
    m4l490nM Offline
    m4l490n
    wrote on last edited by JKSH
    #1

    [EDIT: Forked from https://forum.qt.io/topic/91750/why-a-gui-looks-different-on-different-windows-versions/ --JKSH]

    @Flavio-Mesquita

    I'm having the exact same problem. I created an application in Win7, compiled, used windeployqt, and then copied the .exe and all the dependencies to win10. It runs just fine but looks bad. So my question is, were you able to have a consistent GUI by using StyleSheets? What example are you referring to?

    JKSHJ 1 Reply Last reply
    0
    • m4l490nM m4l490n

      [EDIT: Forked from https://forum.qt.io/topic/91750/why-a-gui-looks-different-on-different-windows-versions/ --JKSH]

      @Flavio-Mesquita

      I'm having the exact same problem. I created an application in Win7, compiled, used windeployqt, and then copied the .exe and all the dependencies to win10. It runs just fine but looks bad. So my question is, were you able to have a consistent GUI by using StyleSheets? What example are you referring to?

      JKSHJ Offline
      JKSHJ Offline
      JKSH
      Moderators
      wrote on last edited by
      #2

      @m4l490n said in Why a GUI looks different on different Windows versions?:

      I'm having the exact same problem. I created an application in Win7, compiled, used windeployqt, and then copied the .exe and all the dependencies to win10. It runs just fine but looks bad.

      Can you provide a screenshot?

      So my question is, were you able to have a consistent GUI by using StyleSheets? What example are you referring to?

      @Flavio-Mesquita applied the Fusion style: https://doc.qt.io/qt-5/qapplication.html#setStyle

      Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

      m4l490nM 1 Reply Last reply
      1
      • JKSHJ JKSH

        @m4l490n said in Why a GUI looks different on different Windows versions?:

        I'm having the exact same problem. I created an application in Win7, compiled, used windeployqt, and then copied the .exe and all the dependencies to win10. It runs just fine but looks bad.

        Can you provide a screenshot?

        So my question is, were you able to have a consistent GUI by using StyleSheets? What example are you referring to?

        @Flavio-Mesquita applied the Fusion style: https://doc.qt.io/qt-5/qapplication.html#setStyle

        m4l490nM Offline
        m4l490nM Offline
        m4l490n
        wrote on last edited by m4l490n
        #3

        @JKSH

        Here is a screenshot of both. The image in the top is how it renders in Windows7 and the bottom is in windows 10. It's the exact same code.

        0_1559700199621_Differences.png

        You can see that the numbers are bigger and it's all cramped. I'm wondering how can I make it look the same.

        How do I apply the Fusion style? I have tried putting the code in several places but nothing is changing. I don't know how to do this.

        Thanks!

        JKSHJ 1 Reply Last reply
        0
        • m4l490nM m4l490n

          @JKSH

          Here is a screenshot of both. The image in the top is how it renders in Windows7 and the bottom is in windows 10. It's the exact same code.

          0_1559700199621_Differences.png

          You can see that the numbers are bigger and it's all cramped. I'm wondering how can I make it look the same.

          How do I apply the Fusion style? I have tried putting the code in several places but nothing is changing. I don't know how to do this.

          Thanks!

          JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          @m4l490n said in Why a GUI looks different on different Windows versions?:

          You can see that the numbers are bigger and it's all cramped. I'm wondering how can I make it look the same.

          Your issue is different from @Flavio-Mesquita. He was talking about different background colours; you have different font sizes.

          It looks like you have enabled font scaling in Windows 10 -- is this correct? Does it look better if you connect your Windows 7 PC's screen to your Windows 10 PC?

          How do I apply the Fusion style? I have tried putting the code in several places but nothing is changing. I don't know how to do this.

          Changing styles will not help you if your issue is caused by font scaling, unfortunately.

          Start by reading https://doc.qt.io/qt-5/highdpi.html

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          m4l490nM 1 Reply Last reply
          2
          • JKSHJ JKSH

            @m4l490n said in Why a GUI looks different on different Windows versions?:

            You can see that the numbers are bigger and it's all cramped. I'm wondering how can I make it look the same.

            Your issue is different from @Flavio-Mesquita. He was talking about different background colours; you have different font sizes.

            It looks like you have enabled font scaling in Windows 10 -- is this correct? Does it look better if you connect your Windows 7 PC's screen to your Windows 10 PC?

            How do I apply the Fusion style? I have tried putting the code in several places but nothing is changing. I don't know how to do this.

            Changing styles will not help you if your issue is caused by font scaling, unfortunately.

            Start by reading https://doc.qt.io/qt-5/highdpi.html

            m4l490nM Offline
            m4l490nM Offline
            m4l490n
            wrote on last edited by
            #5

            @JKSH said in Why a GUI looks different on different Windows versions?:

            @m4l490n said in Why a GUI looks different on different Windows versions?:

            You can see that the numbers are bigger and it's all cramped. I'm wondering how can I make it look the same.

            Your issue is different from @Flavio-Mesquita. He was talking about different background colours; you have different font sizes.

            It looks like you have enabled font scaling in Windows 10 -- is this correct?

            It looks like it is indeed a scaling issue. The image on the top is with 125% scaling that was the scaling the Win10 machine has originally. The one at the bottom is with 100% scaling.

            0_1559775014732_684ad5d0-067b-49cf-bfe9-9b1bced97448-image.png

            Nevertheless, it still doesn't look right, much better, but still not as good as Win7. I include the correct image from Win7 below. The one I included in my previous post was incorrect, it is from version 0.3.2b which is not the same I'm using for Win10, the 0.3.0b

            0_1559775292148_61a5ce7f-b6f8-4029-871e-1341f05a8a57-image.png

            Here is an overlay of the two versions.

            0_1559775694892_5e7b8c9b-88df-47f9-b512-b5bb07e81e0b-image.png

            It looks like the window title part is bigger in Win10 and that is pushing everything down. Also, the status and menu bars are a little bigger in Win10

            Isn't this scaling issue avoidable? Alternatively, how can I fix the size with respect to the size of the frames instead of hardcoding the value? Maybe that would solve the issue.

            JKSHJ 2 Replies Last reply
            0
            • m4l490nM m4l490n

              @JKSH said in Why a GUI looks different on different Windows versions?:

              @m4l490n said in Why a GUI looks different on different Windows versions?:

              You can see that the numbers are bigger and it's all cramped. I'm wondering how can I make it look the same.

              Your issue is different from @Flavio-Mesquita. He was talking about different background colours; you have different font sizes.

              It looks like you have enabled font scaling in Windows 10 -- is this correct?

              It looks like it is indeed a scaling issue. The image on the top is with 125% scaling that was the scaling the Win10 machine has originally. The one at the bottom is with 100% scaling.

              0_1559775014732_684ad5d0-067b-49cf-bfe9-9b1bced97448-image.png

              Nevertheless, it still doesn't look right, much better, but still not as good as Win7. I include the correct image from Win7 below. The one I included in my previous post was incorrect, it is from version 0.3.2b which is not the same I'm using for Win10, the 0.3.0b

              0_1559775292148_61a5ce7f-b6f8-4029-871e-1341f05a8a57-image.png

              Here is an overlay of the two versions.

              0_1559775694892_5e7b8c9b-88df-47f9-b512-b5bb07e81e0b-image.png

              It looks like the window title part is bigger in Win10 and that is pushing everything down. Also, the status and menu bars are a little bigger in Win10

              Isn't this scaling issue avoidable? Alternatively, how can I fix the size with respect to the size of the frames instead of hardcoding the value? Maybe that would solve the issue.

              JKSHJ Offline
              JKSHJ Offline
              JKSH
              Moderators
              wrote on last edited by JKSH
              #6

              @m4l490n said in GUI font sizing issues on different Windows versions:

              It looks like the window title part is bigger in Win10 and that is pushing everything down. Also, the status and menu bars are a little bigger in Win10

              Isn't this scaling issue avoidable? Alternatively, how can I fix the size with respect to the size of the frames instead of hardcoding the value? Maybe that would solve the issue.

              As a general rule: If an app uses fixed-size widgets and fonts (and/or if the app uses absolute coordinates to position the widgets and text), it will only look good on the OS and screen resolution that it is originally built for.

              My first recommendation: Rewrite your GUI to use layouts (https://doc.qt.io/qt-5/layout.html ). This allows your GUI to dynamically decide the best sizes and positions for its components, no matter which OS it's running on.

              For example, your custom "channel box" could be arranged this way:

              • QFrame (thick outer frame)
                • QVBoxLayout
                  • QLabel ("Channel N")
                  • QLabel or QLCDNumber (large green number)
                  • QGridLayout
                    • QPushButton? ("Minimum") | QPushButton? ("Maximum")
                    • QLabel (min value) | QLabel (max value)

              If your app also needs to support all kinds of screens (from low-DPI 1024x768 screens to high-DPI 4k screens), then you must also make your app DPI aware (https://doc.qt.io/qt-5/highdpi.html )

              Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

              1 Reply Last reply
              3
              • m4l490nM m4l490n

                @JKSH said in Why a GUI looks different on different Windows versions?:

                @m4l490n said in Why a GUI looks different on different Windows versions?:

                You can see that the numbers are bigger and it's all cramped. I'm wondering how can I make it look the same.

                Your issue is different from @Flavio-Mesquita. He was talking about different background colours; you have different font sizes.

                It looks like you have enabled font scaling in Windows 10 -- is this correct?

                It looks like it is indeed a scaling issue. The image on the top is with 125% scaling that was the scaling the Win10 machine has originally. The one at the bottom is with 100% scaling.

                0_1559775014732_684ad5d0-067b-49cf-bfe9-9b1bced97448-image.png

                Nevertheless, it still doesn't look right, much better, but still not as good as Win7. I include the correct image from Win7 below. The one I included in my previous post was incorrect, it is from version 0.3.2b which is not the same I'm using for Win10, the 0.3.0b

                0_1559775292148_61a5ce7f-b6f8-4029-871e-1341f05a8a57-image.png

                Here is an overlay of the two versions.

                0_1559775694892_5e7b8c9b-88df-47f9-b512-b5bb07e81e0b-image.png

                It looks like the window title part is bigger in Win10 and that is pushing everything down. Also, the status and menu bars are a little bigger in Win10

                Isn't this scaling issue avoidable? Alternatively, how can I fix the size with respect to the size of the frames instead of hardcoding the value? Maybe that would solve the issue.

                JKSHJ Offline
                JKSHJ Offline
                JKSH
                Moderators
                wrote on last edited by
                #7

                @m4l490n said in GUI font sizing issues on different Windows versions:

                it still doesn't look right, much better, but still not as good as Win7.

                If I'm not mistaken, you must reboot (or at least log off) after you change your scaling settings to see the full improvement.

                Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

                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