From 12f390c94f6c1ab237e2c3127645126b9b7721e0 Mon Sep 17 00:00:00 2001 From: zeljko Date: Fri, 8 Jul 2011 19:25:50 +0000 Subject: [PATCH] Qt: fixed slow drawing because of wrong implementation of TQtWidgetSet.ExcludeClipRect(). issue #19698 git-svn-id: trunk@31604 - --- lcl/interfaces/qt/qtwinapi.inc | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/lcl/interfaces/qt/qtwinapi.inc b/lcl/interfaces/qt/qtwinapi.inc index eef011f4a2..f80fbd589e 100644 --- a/lcl/interfaces/qt/qtwinapi.inc +++ b/lcl/interfaces/qt/qtwinapi.inc @@ -1866,17 +1866,24 @@ end; ------------------------------------------------------------------------------} function TQtWidgetSet.ExcludeClipRect(dc: hdc; Left, Top, Right, Bottom : Integer) : Integer; +(* var Region: QRegionH; ExRegion: QRegionH; QtDC: TQtDeviceContext absolute dc; +*) begin {$ifdef VerboseQtWinAPI} WriteLn('[WinAPI ExcludeClipRect]'); {$endif} - Result := ERROR; + Result := inherited ExcludeClipRect(DC, Left, Top, Right, Bottom); + exit; + {$warning TQtWidgetSet.ExcludeClipRect is calling inherited ExcludeClipRect + because this code is too slow for some reason} + (* + Result := ERROR; if not IsValidDC(DC) then Exit; ExRegion := QRegion_create(Left, Top, Right - Left, Bottom - Top, QRegionRectangle); @@ -1898,6 +1905,7 @@ begin QRegion_destroy(Region); QRegion_destroy(ExRegion); end; + *) end; function TQtWidgetSet.ExtCreatePen(dwPenStyle, dwWidth: DWord; @@ -4729,20 +4737,21 @@ var QtWidget: TQtWidget absolute Wnd; Region: TQtRegion absolute hrgnUpdate; begin - if (lprcUpdate = nil) and (hrgnUpdate = 0) - then begin - if Wnd = 0 - then begin + if (lprcUpdate = nil) and (hrgnUpdate = 0) then + begin + if Wnd = 0 then + begin // redraw desktop Exit(False); end; - QWidget_update(QtWidget.Widget); + QtWidget.Update(nil); Exit(True); end; - if Region = nil - then Result := InvalidateRect(Wnd, lprcUpdate, False) - else begin + if Region = nil then + Result := InvalidateRect(Wnd, lprcUpdate, False) + else + begin QWidget_update(QtWidget.Widget, Region.Widget); Result := True; end; @@ -5624,7 +5633,7 @@ begin begin TQtWidget(Handle).Props[str] := Data; result:=(TQtWidget(Handle).Props[str]=Data); - {$ifdef VerboseQT} + {$ifdef VerboseQtWinApi} DebugLn('[WinAPI SetProp win=%s str=%s data=%x',[dbgsname(TQtWidget(Handle)), str, ptrint(data)]); {$endif} end else