Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt
  • Unsolved
Collapse
qtws26_logo

The Qt Event of the Year: Qt World Summit 2026

Save Your Spot >
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Why my Qt has different resolution with my computer?
Qt 6.12 LTS is out! See what's new in the release blog

Why my Qt has different resolution with my computer?

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 1.6k Views 2 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.
  • E Offline
    E Offline
    Eric Carthage
    wrote on last edited by
    #1

    Hey guys,

         The resolution of my screen is 1980*1080, which is proved by the following code:
        GetSystemMetrics(SM_CXFULLSCREEN);
        GetSystemMetrics(SM_CYFULLSCREEN);
       However, when I maximized main window and output  WIDTH = this->width(); HEIGHT = this->height();
    
      I found WIDTH = 1024 and HEIGHT=768. I checked QGuiApplication::primaryScreen()->size(); and got the same result.
      I know my question may be stupid, but after checking many blogs, I didn't find the solution.
      I will deeply appreciate it if you can lend me a hand. Many thanks.
    
    Paul ColbyP 1 Reply Last reply
    0
    • E Eric Carthage

      Hey guys,

           The resolution of my screen is 1980*1080, which is proved by the following code:
          GetSystemMetrics(SM_CXFULLSCREEN);
          GetSystemMetrics(SM_CYFULLSCREEN);
         However, when I maximized main window and output  WIDTH = this->width(); HEIGHT = this->height();
      
        I found WIDTH = 1024 and HEIGHT=768. I checked QGuiApplication::primaryScreen()->size(); and got the same result.
        I know my question may be stupid, but after checking many blogs, I didn't find the solution.
        I will deeply appreciate it if you can lend me a hand. Many thanks.
      
      Paul ColbyP Offline
      Paul ColbyP Offline
      Paul Colby
      wrote on last edited by
      #2

      Hi @Eric-Carthage,

      My guess, is you're seeing some Windows high-DPI/scaling effect, where Windows is fudging the values reported to the app, then up-scaling.

      Maybe follow this thread?

      Cheers.

      E 1 Reply Last reply
      0
      • Paul ColbyP Paul Colby

        Hi @Eric-Carthage,

        My guess, is you're seeing some Windows high-DPI/scaling effect, where Windows is fudging the values reported to the app, then up-scaling.

        Maybe follow this thread?

        Cheers.

        E Offline
        E Offline
        Eric Carthage
        wrote on last edited by
        #3

        @Paul-Colby sorry I didn't get your point. Can you explain it in a more specific way? Thanks.

        S 1 Reply Last reply
        0
        • E Eric Carthage

          @Paul-Colby sorry I didn't get your point. Can you explain it in a more specific way? Thanks.

          S Offline
          S Offline
          SimonSchroeder
          wrote on last edited by
          #4

          @Eric-Carthage What does QGuiApplication::primaryScreen()->devicePixelRatio() return (though I think this is always 1)? Maybe report your results for logicalDotsPerInch() and physicalDotsPerInch() of the primary screen as well. Do you have more than 1 screen?

          E 1 Reply Last reply
          0
          • S SimonSchroeder

            @Eric-Carthage What does QGuiApplication::primaryScreen()->devicePixelRatio() return (though I think this is always 1)? Maybe report your results for logicalDotsPerInch() and physicalDotsPerInch() of the primary screen as well. Do you have more than 1 screen?

            E Offline
            E Offline
            Eric Carthage
            wrote on last edited by
            #5

            @SimonSchroeder No I only use the screen of my laptop

            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
            • Unsolved