From 3e71fee9df95d710a49745dc47910b052d8c5416 Mon Sep 17 00:00:00 2001 From: zeljko Date: Mon, 17 Jun 2013 11:32:16 +0000 Subject: [PATCH] Qt: return correct lfHeight inside TQtWidgetSet.GetObject. issue #24613 git-svn-id: trunk@41739 - --- lcl/interfaces/qt/qtwinapi.inc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/lcl/interfaces/qt/qtwinapi.inc b/lcl/interfaces/qt/qtwinapi.inc index 98962baf28..088106f076 100644 --- a/lcl/interfaces/qt/qtwinapi.inc +++ b/lcl/interfaces/qt/qtwinapi.inc @@ -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;