mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-30 05:30:45 +02:00
Qt: fixed TQtWidgetSet.GetDeviceCaps() to return correct result for hdc.
git-svn-id: trunk@30596 -
This commit is contained in:
parent
65907a7def
commit
244f96a67c
@ -2318,24 +2318,24 @@ function TQtWidgetSet.GetDeviceCaps(DC: HDC; Index: Integer): Integer;
|
||||
var
|
||||
QtDC: TQtDeviceContext;
|
||||
PaintDevice: QPaintDeviceH;
|
||||
w: QWidgetH;
|
||||
PaintEngine: QPaintEngineH;
|
||||
begin
|
||||
{$ifdef VerboseQtWinAPI}
|
||||
WriteLn('[WinAPI GetDeviceCaps] DC ' + dbghex(DC));
|
||||
{$endif}
|
||||
|
||||
Result := 0;
|
||||
if DC = 0 then
|
||||
DC := HDC(QtScreenContext);
|
||||
|
||||
if not IsValidDC(DC) then exit;
|
||||
|
||||
QtDC := TQtDeviceContext(DC);
|
||||
|
||||
if QtDC.Parent <> nil
|
||||
then
|
||||
w := QtDC.Parent
|
||||
else
|
||||
w := QApplication_desktop;
|
||||
|
||||
PaintDevice := QWidget_to_QPaintDevice(w);
|
||||
PaintEngine := QtDC.PaintEngine;
|
||||
if PaintEngine = nil then
|
||||
exit;
|
||||
PaintDevice := QPaintEngine_paintDevice(PaintEngine);
|
||||
|
||||
case Index of
|
||||
HORZSIZE:
|
||||
|
Loading…
Reference in New Issue
Block a user