Qt,Qt5: fixed wrong PPI calculation. issue #34625

git-svn-id: trunk@59708 -
This commit is contained in:
zeljko 2018-11-30 17:11:59 +00:00
parent 7e4591f52c
commit 5db60e1bdd
2 changed files with 17 additions and 1 deletions

View File

@ -259,8 +259,16 @@ begin
ScreenDC := GetDC(0);
try
{$IFDEF DARWIN}
// this code is removed in r57679, and cocoa/carbon are fixed separatelly, so
// qt/qt5 wasn't good with standard mac ppi 72. Cocoa ws uses CocoaBasePPI const.
// issue #34625
ScreenInfo.PixelsPerInchX := 96;
ScreenInfo.PixelsPerInchY := 96;
{$ELSE}
ScreenInfo.PixelsPerInchX := GetDeviceCaps(ScreenDC, LOGPIXELSX);
ScreenInfo.PixelsPerInchY := GetDeviceCaps(ScreenDC, LOGPIXELSY);
{$ENDIF}
ScreenInfo.ColorDepth := GetDeviceCaps(ScreenDC, BITSPIXEL);
finally
ReleaseDC(0, ScreenDC);

View File

@ -207,13 +207,21 @@ begin
ScreenDC := GetDC(0);
try
{$IFDEF DARWIN}
// this code is removed in r57679, and cocoa/carbon are fixed separatelly, so
// qt/qt5 wasn't good with standard mac ppi 72. Cocoa ws uses CocoaBasePPI const.
// issue #34625
ScreenInfo.PixelsPerInchX := 96;
ScreenInfo.PixelsPerInchY := 96;
{$ELSE}
ScreenInfo.PixelsPerInchX := GetDeviceCaps(ScreenDC, LOGPIXELSX);
ScreenInfo.PixelsPerInchY := GetDeviceCaps(ScreenDC, LOGPIXELSY);
{$ENDIF}
ScreenInfo.ColorDepth := GetDeviceCaps(ScreenDC, BITSPIXEL);
finally
ReleaseDC(0, ScreenDC);
end;
QtDefaultPrinter;
{$IFNDEF MSWINDOWS}
// initialize clipboard