mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-21 16:59:55 +02:00
Qt: return correct lfHeight inside TQtWidgetSet.GetObject. issue #24613
git-svn-id: trunk@41739 -
This commit is contained in:
parent
2f683eb55b
commit
3e71fee9df
@ -3115,6 +3115,7 @@ var
|
|||||||
ALogBrush: PLogBrush absolute Buf;
|
ALogBrush: PLogBrush absolute Buf;
|
||||||
Dashes: TQRealArray;
|
Dashes: TQRealArray;
|
||||||
i: integer;
|
i: integer;
|
||||||
|
PaintDevice: QPaintDeviceH;
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
ObjType: string;
|
ObjType: string;
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -3150,7 +3151,15 @@ begin
|
|||||||
Result := SizeOf(TLogFont);
|
Result := SizeOf(TLogFont);
|
||||||
|
|
||||||
FillChar(ALogFont^, SizeOf(ALogFont^), 0);
|
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;
|
ALogFont^.lfEscapement := AFont.Angle;
|
||||||
case AFont.getWeight of
|
case AFont.getWeight of
|
||||||
10: ALogFont^.lfWeight := FW_THIN;
|
10: ALogFont^.lfWeight := FW_THIN;
|
||||||
|
Loading…
Reference in New Issue
Block a user