Why my Qt has different resolution with my computer?
-
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. -
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.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.
-
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.
@Paul-Colby sorry I didn't get your point. Can you explain it in a more specific way? Thanks.
-
@Paul-Colby sorry I didn't get your point. Can you explain it in a more specific way? Thanks.
@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? -
@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?@SimonSchroeder No I only use the screen of my laptop