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?
Forum Updated to NodeBB v4.3 + New Features

Why do text items have different results on the screen?

Scheduled Pinned Locked Moved Unsolved General and Desktop
13 Posts 5 Posters 2.5k Views 3 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.
  • P Offline
    P Offline
    Pada_
    wrote on last edited by Pada_
    #1

    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 ??

    ODБOïO 1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

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

      (Z(:^

      1 Reply Last reply
      3
      • P Pada_

        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 ??

        ODБOïO Offline
        ODБOïO Offline
        ODБOï
        wrote on 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
        3
        • ODБOïO ODБOï

          @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 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?

          ODБOïO 1 Reply Last reply
          0
          • P Pada_

            @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?

            ODБOïO Offline
            ODБOïO Offline
            ODБOï
            wrote on 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
            0
            • ODБOïO ODБOï

              @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 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
              • ODБOïO ODБOï

                @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 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

                jsulmJ 1 Reply Last reply
                0
                • P Pada_

                  @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

                  jsulmJ Offline
                  jsulmJ Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 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
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on 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
                    • jsulmJ jsulm

                      @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 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
                      • mrjjM Offline
                        mrjjM Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 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
                        0
                        • mrjjM mrjj

                          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 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%.

                          mrjjM 1 Reply Last reply
                          0
                          • P Pada_

                            @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%.

                            mrjjM Offline
                            mrjjM Offline
                            mrjj
                            Lifetime Qt Champion
                            wrote on 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

                            • Login

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