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. Interface adaptive screen resolution
Forum Updated to NodeBB v4.3 + New Features

Interface adaptive screen resolution

Scheduled Pinned Locked Moved Unsolved General and Desktop
8 Posts 4 Posters 637 Views 1 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
    PhillLi
    wrote on last edited by
    #1

    I followed the online tutorial and added QCoreApplication: setAttribute (Qt:: AA-EnableHighDpiScaling) to the code; This statement reveals that the interface will exceed the screen size the first time it is opened (the interface size is 1920 * 180, and the screen resolution is 2560 * 1440), and then it can be perfectly adapted to the small resolution interface (the small resolution screen is 1920 * 1080)

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

      Hi and welcome to devnet,

      What is you question ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      P 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        What is you question ?

        P Offline
        P Offline
        PhillLi
        wrote on last edited by
        #3

        @SGaist said in Interface adaptive screen resolution:

        Hi and welcome to devnet,

        What is you question ?

        How Interface adaptive screen resolution in QT?
        Now I do somethingt to solve,but unsuccess. Example, I followed the online tutorial and added QCoreApplication: setAttribute (Qt:: AA-EnableHighDpiScaling) to the code; This statement reveals that the interface will exceed the screen size the first time it is opened (the interface size is 1920 * 180, and the screen resolution is 2560 * 1440), and then it can be perfectly adapted to the small resolution interface (the small resolution screen is 1920 * 1080).

        C 1 Reply Last reply
        0
        • P PhillLi

          @SGaist said in Interface adaptive screen resolution:

          Hi and welcome to devnet,

          What is you question ?

          How Interface adaptive screen resolution in QT?
          Now I do somethingt to solve,but unsuccess. Example, I followed the online tutorial and added QCoreApplication: setAttribute (Qt:: AA-EnableHighDpiScaling) to the code; This statement reveals that the interface will exceed the screen size the first time it is opened (the interface size is 1920 * 180, and the screen resolution is 2560 * 1440), and then it can be perfectly adapted to the small resolution interface (the small resolution screen is 1920 * 1080).

          C Offline
          C Offline
          ChrisW67
          wrote on last edited by
          #4

          @PhillLi The Qt5 Qt::AA_EnableHighDPI attribute controls whether the application adapts for the pixel density of a display using an approach matched to the operating system involved. This density is not only related to the total pixel horizontal X vertical i.e., the screen resolution.

          It appears you are expecting that this will scale your application UI to occupy either the whole available screen or some fixed portion of it. This is not the purpose of the flag.

          Perhaps you can share with us:

          • which online tutorial you were following, and
          • what statement you are referring to.
          P 1 Reply Last reply
          2
          • C ChrisW67

            @PhillLi The Qt5 Qt::AA_EnableHighDPI attribute controls whether the application adapts for the pixel density of a display using an approach matched to the operating system involved. This density is not only related to the total pixel horizontal X vertical i.e., the screen resolution.

            It appears you are expecting that this will scale your application UI to occupy either the whole available screen or some fixed portion of it. This is not the purpose of the flag.

            Perhaps you can share with us:

            • which online tutorial you were following, and
            • what statement you are referring to.
            P Offline
            P Offline
            PhillLi
            wrote on last edited by
            #5

            @ChrisW67 I just hope to achieve Qt interface that can adapt to screens of different resolutions, but now I don't know how to solve this or what methods can be used to implement it

            Christian EhrlicherC P 2 Replies Last reply
            0
            • P PhillLi

              @ChrisW67 I just hope to achieve Qt interface that can adapt to screens of different resolutions, but now I don't know how to solve this or what methods can be used to implement it

              Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @PhillLi said in Interface adaptive screen resolution:

              screens of different resolutions, but now I don't know how to solve this or what methods can be used to implement it

              Use a proper layout.

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              1
              • P PhillLi

                @ChrisW67 I just hope to achieve Qt interface that can adapt to screens of different resolutions, but now I don't know how to solve this or what methods can be used to implement it

                P Offline
                P Offline
                PhillLi
                wrote on last edited by
                #7

                @PhillLi said in Interface adaptive screen resolution:

                hope
                I used the method QCoreApplication: setAttribute (Qt:: AA Enable High DpiScaling), but the actual effect was not reasonable enough

                SGaistS 1 Reply Last reply
                0
                • P PhillLi

                  @PhillLi said in Interface adaptive screen resolution:

                  hope
                  I used the method QCoreApplication: setAttribute (Qt:: AA Enable High DpiScaling), but the actual effect was not reasonable enough

                  SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  @PhillLi that does not answer the main issue: are you using layouts ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  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