- qt: reimplement getDeviceSize

git-svn-id: trunk@11926 -
This commit is contained in:
paul 2007-09-03 07:24:47 +00:00
parent 146f5e01f2
commit 0fbe24b1c2
2 changed files with 11 additions and 9 deletions

View File

@ -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

View File

@ -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;