mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-08 14:56:20 +02:00
Qt: replaced obsoleted class QMatrix with QTransform.
git-svn-id: trunk@23523 -
This commit is contained in:
parent
a789d15c12
commit
1039496739
@ -353,7 +353,7 @@ type
|
|||||||
function getCompositionMode: QPainterCompositionMode;
|
function getCompositionMode: QPainterCompositionMode;
|
||||||
procedure setCompositionMode(mode: QPainterCompositionMode);
|
procedure setCompositionMode(mode: QPainterCompositionMode);
|
||||||
procedure getPenPos(retval: PPoint);
|
procedure getPenPos(retval: PPoint);
|
||||||
function getWorldMatrix: QMatrixH;
|
function getWorldTransform: QTransformH;
|
||||||
procedure setBrushOrigin(x, y: Integer);
|
procedure setBrushOrigin(x, y: Integer);
|
||||||
procedure setPenPos(x, y: Integer);
|
procedure setPenPos(x, y: Integer);
|
||||||
|
|
||||||
@ -2491,9 +2491,9 @@ begin
|
|||||||
retval^.y := FPenPos.y;
|
retval^.y := FPenPos.y;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function TQtDeviceContext.getWorldMatrix: QMatrixH;
|
function TQtDeviceContext.getWorldTransform: QTransformH;
|
||||||
begin
|
begin
|
||||||
Result := QPainter_worldMatrix(Widget);
|
Result := QPainter_worldTransform(Widget);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TQtDeviceContext.setPenPos(x, y: Integer);
|
procedure TQtDeviceContext.setPenPos(x, y: Integer);
|
||||||
|
@ -1149,8 +1149,8 @@ function TQtWidgetSet.DPtoLP(DC: HDC; var Points; Count: Integer): BOOL;
|
|||||||
var
|
var
|
||||||
P: PPoint;
|
P: PPoint;
|
||||||
QtPoint: TQtPoint;
|
QtPoint: TQtPoint;
|
||||||
Matrix: QMatrixH;
|
Matrix: QTransformH;
|
||||||
MatrixInv: QMatrixH;
|
MatrixInv: QTransformH;
|
||||||
QtDC: TQtDeviceContext;
|
QtDC: TQtDeviceContext;
|
||||||
Inverted: Boolean;
|
Inverted: Boolean;
|
||||||
begin
|
begin
|
||||||
@ -1166,19 +1166,19 @@ begin
|
|||||||
|
|
||||||
QtDC := TQtDeviceContext(DC);
|
QtDC := TQtDeviceContext(DC);
|
||||||
|
|
||||||
Matrix := QMatrix_create;
|
Matrix := QTransform_create;
|
||||||
MatrixInv := QMatrix_create;
|
MatrixInv := QTransform_create;
|
||||||
QPainter_combinedMatrix(QtDC.Widget, Matrix);
|
QPainter_combinedTransform(QtDC.Widget, Matrix);
|
||||||
P := @Points;
|
P := @Points;
|
||||||
try
|
try
|
||||||
while Count > 0 do
|
while Count > 0 do
|
||||||
begin
|
begin
|
||||||
Dec(Count);
|
Dec(Count);
|
||||||
Inverted := QMatrix_isInvertible(Matrix);
|
Inverted := QTransform_isInvertible(Matrix);
|
||||||
QMatrix_inverted(Matrix, MatrixInv, @Inverted);
|
QTransform_inverted(Matrix, MatrixInv, @Inverted);
|
||||||
QtPoint.X := P^.X;
|
QtPoint.X := P^.X;
|
||||||
QtPoint.Y := P^.Y;
|
QtPoint.Y := P^.Y;
|
||||||
QMatrix_map(MatrixInv, @QtPoint, @QtPoint);
|
QTransform_map(MatrixInv, @QtPoint, @QtPoint);
|
||||||
P^.X := QtPoint.X;
|
P^.X := QtPoint.X;
|
||||||
P^.Y := QtPoint.Y;
|
P^.Y := QtPoint.Y;
|
||||||
Inc(P);
|
Inc(P);
|
||||||
@ -1186,8 +1186,8 @@ begin
|
|||||||
|
|
||||||
Result := True;
|
Result := True;
|
||||||
finally
|
finally
|
||||||
QMatrix_destroy(MatrixInv);
|
QTransform_destroy(MatrixInv);
|
||||||
QMatrix_destroy(Matrix);
|
QTransform_destroy(Matrix);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2139,7 +2139,7 @@ function TQtWidgetSet.GetDCOriginRelativeToWindow(PaintDC: HDC;
|
|||||||
WindowHandle: HWND; var OriginDiff: TPoint): boolean;
|
WindowHandle: HWND; var OriginDiff: TPoint): boolean;
|
||||||
var
|
var
|
||||||
QtDC: TQtDeviceContext absolute PaintDC;
|
QtDC: TQtDeviceContext absolute PaintDC;
|
||||||
Matrix: QMatrixH;
|
Matrix: QTransformH;
|
||||||
P: TPoint;
|
P: TPoint;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
@ -2148,15 +2148,15 @@ begin
|
|||||||
Result := IsValidDC(PaintDC);
|
Result := IsValidDC(PaintDC);
|
||||||
if not Result then
|
if not Result then
|
||||||
exit;
|
exit;
|
||||||
Matrix := QPainter_Matrix(QtDC.Widget);
|
Matrix := QPainter_transform(QtDC.Widget);
|
||||||
OriginDiff := Point(0, 0);
|
OriginDiff := Point(0, 0);
|
||||||
P := Point(0, 0);
|
P := Point(0, 0);
|
||||||
if WindowHandle <> 0 then
|
if WindowHandle <> 0 then
|
||||||
P := TQtWidget(WindowHandle).getClientOffset;
|
P := TQtWidget(WindowHandle).getClientOffset;
|
||||||
if Matrix <> nil then
|
if Matrix <> nil then
|
||||||
begin
|
begin
|
||||||
OriginDiff.X := Round(QMatrix_Dx(Matrix)) - P.X;
|
OriginDiff.X := Round(QTransform_Dx(Matrix)) - P.X;
|
||||||
OriginDiff.Y := Round(QMatrix_Dy(Matrix)) - P.Y;
|
OriginDiff.Y := Round(QTransform_Dy(Matrix)) - P.Y;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -3446,7 +3446,7 @@ end;
|
|||||||
------------------------------------------------------------------------------}
|
------------------------------------------------------------------------------}
|
||||||
function TQtWidgetSet.GetWindowOrgEx(dc: hdc; P: PPoint): Integer;
|
function TQtWidgetSet.GetWindowOrgEx(dc: hdc; P: PPoint): Integer;
|
||||||
var
|
var
|
||||||
Matrix: QMatrixH;
|
Matrix: QTransformH;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
WriteLn('Trace: > [WinAPI GetWindowOrgEx]');
|
WriteLn('Trace: > [WinAPI GetWindowOrgEx]');
|
||||||
@ -3460,11 +3460,11 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Matrix := QPainter_Matrix(TQtDeviceContext(DC).Widget);
|
Matrix := QPainter_transform(TQtDeviceContext(DC).Widget);
|
||||||
if Matrix <> nil then
|
if Matrix <> nil then
|
||||||
begin
|
begin
|
||||||
P^.X := -Trunc(QMatrix_Dx(Matrix));
|
P^.X := -Trunc(QTransform_Dx(Matrix));
|
||||||
P^.Y := -Trunc(QMatrix_Dy(Matrix));
|
P^.Y := -Trunc(QTransform_Dy(Matrix));
|
||||||
result := 1;
|
result := 1;
|
||||||
end;
|
end;
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
@ -5149,7 +5149,7 @@ var
|
|||||||
SrcWidthOrig, SrcHeightOrig: Integer;
|
SrcWidthOrig, SrcHeightOrig: Integer;
|
||||||
Image, TmpImage, QMask, TmpMask: QImageH;
|
Image, TmpImage, QMask, TmpMask: QImageH;
|
||||||
TmpPixmap: QPixmapH;
|
TmpPixmap: QPixmapH;
|
||||||
SrcMatrix: QMatrixH;
|
SrcMatrix: QTransformH;
|
||||||
dx, dy: integer;
|
dx, dy: integer;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQtWinAPI}
|
{$ifdef VerboseQtWinAPI}
|
||||||
@ -5165,7 +5165,7 @@ begin
|
|||||||
|
|
||||||
Result := False;
|
Result := False;
|
||||||
|
|
||||||
SrcMatrix := QPainter_Matrix(SrcQDC.Widget);
|
SrcMatrix := QPainter_transform(SrcQDC.Widget);
|
||||||
if SrcQDC.vImage = nil then
|
if SrcQDC.vImage = nil then
|
||||||
begin
|
begin
|
||||||
if SrcQDC.Parent <> nil then
|
if SrcQDC.Parent <> nil then
|
||||||
@ -5184,7 +5184,7 @@ begin
|
|||||||
Image := SrcQDC.vImage.Handle;
|
Image := SrcQDC.vImage.Handle;
|
||||||
SrcWidthOrig := QImage_width(Image);
|
SrcWidthOrig := QImage_width(Image);
|
||||||
SrcHeightOrig := QImage_height(Image);
|
SrcHeightOrig := QImage_height(Image);
|
||||||
QMatrix_map(SrcMatrix, XSrc, YSrc, @XSrc, @YSrc);
|
QTransform_map(SrcMatrix, XSrc, YSrc, @XSrc, @YSrc);
|
||||||
// our map can have some transformations
|
// our map can have some transformations
|
||||||
if XSrc < 0 then // we cannot draw from negative coord, so we will draw from zero with shift
|
if XSrc < 0 then // we cannot draw from negative coord, so we will draw from zero with shift
|
||||||
begin
|
begin
|
||||||
|
Loading…
Reference in New Issue
Block a user