Qt: return correct lfHeight inside TQtWidgetSet.GetObject. issue #24613

git-svn-id: trunk@41739 -
This commit is contained in:
zeljko 2013-06-17 11:32:16 +00:00
parent 2f683eb55b
commit 3e71fee9df

View File

@ -3115,6 +3115,7 @@ var
ALogBrush: PLogBrush absolute Buf;
Dashes: TQRealArray;
i: integer;
PaintDevice: QPaintDeviceH;
{$ifdef VerboseQtWinAPI}
ObjType: string;
{$endif}
@ -3150,7 +3151,15 @@ begin
Result := SizeOf(TLogFont);
FillChar(ALogFont^, SizeOf(ALogFont^), 0);
ALogFont^.lfHeight := AFont.getPixelSize;
if AFont.getPixelSize = -1 then
begin
PaintDevice := QWidget_to_QPaintDevice(QApplication_desktop);
if PaintDevice <> nil then
ALogFont^.lfHeight := MulDiv(AFont.getPointSize, QPaintDevice_logicalDpiX(PaintDevice), 72)
else
ALogFont^.lfHeight := AFont.getPointSize;
end else
ALogFont^.lfHeight := AFont.getPixelSize;
ALogFont^.lfEscapement := AFont.Angle;
case AFont.getWeight of
10: ALogFont^.lfWeight := FW_THIN;