mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-07 15:20:30 +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;
|
||||
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;
|
||||
|
Loading…
Reference in New Issue
Block a user