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. Why do text items have different results on the screen?

Why do text items have different results on the screen?

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 5 Posters 2.4k 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.
  • S Offline
    S Offline
    sierdzio
    Moderators
    wrote on 17 Mar 2020, 11:45 last edited by
    #2

    DPI scaling. Windows is likely showing everything scaled up by 150%.

    (Z(:^

    1 Reply Last reply
    3
    • P Pada_
      17 Mar 2020, 11:37

      Hello,

      I have two development environments.

      1.Windows8.1 64bit graphics 1920x1080 (moniter 15.6 inch)
      2. Linux 64Bit Graphics 1920x1080 (moniter 23 inch)

      I created QTextEdit using QProxyWidget in QGraphicsScene.

      The size of this item is 300x300,
      The font size of the text in the item is setFontSize (22) as follows.

      However, in the development environment of No. 1, QTextEdit has a scroll bar, so the text is not visible.
      In development environment 2, the text was clearly visible without scroll bars.

      Same item size, same text size, but why this difference ??

      Is there any way to look the same ??

      O Offline
      O Offline
      ODБOï
      wrote on 17 Mar 2020, 11:47 last edited by
      #3

      @Pada_
      You are setting font size in pixels,
      depending on your screens pixel density you will have different result
      https://doc.qt.io/qt-5/scalability.html

      P 1 Reply Last reply 17 Mar 2020, 12:52
      3
      • O ODБOï
        17 Mar 2020, 11:47

        @Pada_
        You are setting font size in pixels,
        depending on your screens pixel density you will have different result
        https://doc.qt.io/qt-5/scalability.html

        P Offline
        P Offline
        Pada_
        wrote on 17 Mar 2020, 12:52 last edited by
        #4

        @LeLev
        @sierdzio

        0fa7f1b3-dc13-4c3f-8841-9d89fd29647e-image.png

        605c3606-f96f-4802-a7cd-12d46be7d4a1-image.png

        SetPointSize & setPixelSize exists in QFont Class.
         
        When setting FontSize in QFont,
        If setPixelSize is set, not setPointSize

        Can I check the result of the same shape in development environment with different resolution?

        O 1 Reply Last reply 17 Mar 2020, 21:20
        0
        • P Pada_
          17 Mar 2020, 12:52

          @LeLev
          @sierdzio

          0fa7f1b3-dc13-4c3f-8841-9d89fd29647e-image.png

          605c3606-f96f-4802-a7cd-12d46be7d4a1-image.png

          SetPointSize & setPixelSize exists in QFont Class.
           
          When setting FontSize in QFont,
          If setPixelSize is set, not setPointSize

          Can I check the result of the same shape in development environment with different resolution?

          O Offline
          O Offline
          ODБOï
          wrote on 17 Mar 2020, 21:20 last edited by
          #5

          @Pada_ said in Why do text items have different results on the screen?:

          Can I check the result of the same shape in development environment with different resolution?

          IMHO no
          you can ensure the final aspect is the same on any screen by using techniques from the link

          P 2 Replies Last reply 17 Mar 2020, 23:01
          0
          • O ODБOï
            17 Mar 2020, 21:20

            @Pada_ said in Why do text items have different results on the screen?:

            Can I check the result of the same shape in development environment with different resolution?

            IMHO no
            you can ensure the final aspect is the same on any screen by using techniques from the link

            P Offline
            P Offline
            Pada_
            wrote on 17 Mar 2020, 23:01 last edited by
            #6

            @LeLev

            I don't know what it means.

            Even if you use setPixelSize, you cannot see the same result depending on the resolution.

            Are you saying?

            Then the size of the 300x300 item, the size of the inner text 20
            Will it have to be different for every resolution?

            1 Reply Last reply
            0
            • O ODБOï
              17 Mar 2020, 21:20

              @Pada_ said in Why do text items have different results on the screen?:

              Can I check the result of the same shape in development environment with different resolution?

              IMHO no
              you can ensure the final aspect is the same on any screen by using techniques from the link

              P Offline
              P Offline
              Pada_
              wrote on 18 Mar 2020, 03:05 last edited by Pada_
              #7

              @LeLev
              @sierdzio

              QTextEdit is the same size as the photo, and Font is the same size.

              The first picture is a capture picture on Linux.
              The second picture is a capture picture in Windows.
              Why does QTextEdit and QFont Size change strangely in WIndows? I have a scroll bar.

              43423891-8262-4896-be15-835c47bea309-image.png

              d18435e5-eac7-459f-9a63-b131f3c9f85b-image.png

              J 1 Reply Last reply 18 Mar 2020, 05:41
              0
              • P Pada_
                18 Mar 2020, 03:05

                @LeLev
                @sierdzio

                QTextEdit is the same size as the photo, and Font is the same size.

                The first picture is a capture picture on Linux.
                The second picture is a capture picture in Windows.
                Why does QTextEdit and QFont Size change strangely in WIndows? I have a scroll bar.

                43423891-8262-4896-be15-835c47bea309-image.png

                d18435e5-eac7-459f-9a63-b131f3c9f85b-image.png

                J Offline
                J Offline
                jsulm
                Lifetime Qt Champion
                wrote on 18 Mar 2020, 05:41 last edited by
                #8

                @Pada_ Did you read what @sierdzio wrote? Most probably Windows is upscaling, check that in your Windows settings.

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                P 1 Reply Last reply 18 Mar 2020, 12:50
                0
                • S Offline
                  S Offline
                  sierdzio
                  Moderators
                  wrote on 18 Mar 2020, 05:44 last edited by
                  #9

                  Why does QTextEdit and QFont Size change strangely in WIndows? I have a scroll bar.

                  You are using different fonts (notice that letter "t" has different shape, for example), so they can have different sizes.

                  Plus, as I mentioned, you very probably have DPI or font scaling enabled on Windows. As far as I know Windows used 150% scaling by default on most screen sizes nowadays.

                  (Z(:^

                  1 Reply Last reply
                  1
                  • J jsulm
                    18 Mar 2020, 05:41

                    @Pada_ Did you read what @sierdzio wrote? Most probably Windows is upscaling, check that in your Windows settings.

                    P Offline
                    P Offline
                    Pada_
                    wrote on 18 Mar 2020, 12:50 last edited by Pada_
                    #10

                    @jsulm
                    @sierdzio

                    I haven't looked for upscaling yet,
                    I think it can be done because of upscaling, as it works well on Linux OS and comes out large on other resolutions of Windows.

                    But why does Windows control upscaling?
                    Also, is there a way to get the upscaling currently applied to Windows?

                    Windows uses 150% by default, so

                    Can I create it by reducing 150%?

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mrjj
                      Lifetime Qt Champion
                      wrote on 18 Mar 2020, 14:37 last edited by
                      #11

                      Hi
                      You can try disable DPI scale for your app and see if that works the way you want.
                      https://doc.qt.io/qt-5/highdpi.html

                      The text factor used by Windows is controlled by the user and an app should not change that.
                      (unless its just for your systems and you can just change it )

                      P 1 Reply Last reply 19 Mar 2020, 01:30
                      0
                      • M mrjj
                        18 Mar 2020, 14:37

                        Hi
                        You can try disable DPI scale for your app and see if that works the way you want.
                        https://doc.qt.io/qt-5/highdpi.html

                        The text factor used by Windows is controlled by the user and an app should not change that.
                        (unless its just for your systems and you can just change it )

                        P Offline
                        P Offline
                        Pada_
                        wrote on 19 Mar 2020, 01:30 last edited by
                        #12

                        @mrjj

                        DPI per monitor
                        <Application> -Platform window: dpi awareness = 2
                        I set it up, but it remains the same.

                        Even if the window magnification is set to 125% and 150%, I would like to see it at 100%.

                        M 1 Reply Last reply 19 Mar 2020, 06:52
                        0
                        • P Pada_
                          19 Mar 2020, 01:30

                          @mrjj

                          DPI per monitor
                          <Application> -Platform window: dpi awareness = 2
                          I set it up, but it remains the same.

                          Even if the window magnification is set to 125% and 150%, I would like to see it at 100%.

                          M Offline
                          M Offline
                          mrjj
                          Lifetime Qt Champion
                          wrote on 19 Mar 2020, 06:52 last edited by
                          #13

                          @Pada_
                          Did you try with awareness = 0
                          also did going from 150 to 125, show up any different?

                          1 Reply Last reply
                          0

                          11/13

                          18 Mar 2020, 14:37

                          • Login

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