mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-13 18:29:12 +02:00
Qt: Huge boost to designer painting when "Show grid" enabled (on X11 is at least x10)., implemented qtlclintf DrawGrid().
git-svn-id: trunk@17347 -
This commit is contained in:
parent
dbeb427730
commit
e579957f39
@ -147,6 +147,26 @@ begin
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TQtWidgetSet.DrawGrid(DC: HDC; const R: TRect; DX, DY: Integer);
|
||||
var
|
||||
QtDC: TQtDeviceContext absolute DC;
|
||||
X, Y: Integer;
|
||||
W, H: Integer;
|
||||
begin
|
||||
if not IsValidDC(DC) then
|
||||
exit;
|
||||
QtDC.save;
|
||||
try
|
||||
W := (R.Right - R.Left - 1) div DX;
|
||||
H := (R.Bottom - R.Top - 1) div DY;
|
||||
|
||||
for X := 0 to W do
|
||||
for Y := 0 to H do
|
||||
QtDC.drawPoint(R.Left + X * DX, R.Top + Y * DY + 1);
|
||||
finally
|
||||
QtDC.restore;
|
||||
end;
|
||||
end;
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: FontCanUTF8
|
||||
|
@ -40,6 +40,7 @@ function AddProcessEventHandler(AHandle: THandle;
|
||||
function CreateStandardCursor(ACursor: SmallInt): HCURSOR; override;
|
||||
procedure DrawArrow(Arrow: TComponent; Canvas: TPersistent); override;
|
||||
procedure DrawDefaultDockImage(AOldRect, ANewRect: TRect; AOperation: TDockImageOperation); override;
|
||||
procedure DrawGrid(DC: HDC; const R: TRect; DX, DY: Integer); override;
|
||||
|
||||
function FontCanUTF8(Font: HFont): boolean; override;
|
||||
function FontIsMonoSpace(Font: HFont): boolean; override;
|
||||
|
Loading…
Reference in New Issue
Block a user