mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-28 20:00:20 +02:00
- qt: reimplement getDeviceSize
git-svn-id: trunk@11926 -
This commit is contained in:
parent
146f5e01f2
commit
0fbe24b1c2
@ -275,6 +275,7 @@ type
|
||||
procedure setPen(APen: TQtPen);
|
||||
function SetBkColor(Color: TcolorRef): TColorRef;
|
||||
function SetBkMode(BkMode: Integer): Integer;
|
||||
function getDeviceSize: TPoint;
|
||||
function getRegionType(ARegion: QRegionH): integer;
|
||||
function region: TQtRegion;
|
||||
procedure setRegion(ARegion: TQtRegion);
|
||||
@ -1795,6 +1796,15 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
function TQtDeviceContext.getDeviceSize: TPoint;
|
||||
var
|
||||
device: QPaintDeviceH;
|
||||
begin
|
||||
device := QPainter_device(Widget);
|
||||
Result.x := QPaintDevice_width(device);
|
||||
Result.y := QPaintDevice_height(device);
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: TQtDeviceContext.getRegionType
|
||||
Params: QRegionH
|
||||
|
@ -2037,15 +2037,7 @@ begin
|
||||
if not IsValidDC(DC) then Exit;
|
||||
|
||||
if (TObject(DC) is TQtDeviceContext) then
|
||||
begin
|
||||
if TQtDeviceContext(DC).Parent <> nil then
|
||||
begin
|
||||
QWidget_size(TQtDeviceContext(DC).Parent, @Size);
|
||||
|
||||
P.X := Size.cx;
|
||||
P.Y := Size.cy;
|
||||
end;
|
||||
end;
|
||||
P := TQtDeviceContext(DC).getDeviceSize;
|
||||
|
||||
Result := True;
|
||||
end;
|
||||
|
Loading…
Reference in New Issue
Block a user