View Issue Details

IDProjectCategoryView StatusLast Update
0026744LazarusWidgetsetpublic2014-09-22 13:19
ReporterVojtech Cihak Assigned ToZeljan Rikalo  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Platformamd64OSLinux 
Product Version1.3 (SVN) 
Target Version1.2.6 
Summary0026744: [Qt] CopyRect - regression of 26004
DescriptionCopyRect should copy only a piece of canvas but it stretch-copy all.

Regression of 26004.
Steps To ReproduceUse the demo attached here: http://bugs.freepascal.org/view.php?id=26004

Click on InvalidateRect shows red/yellow rectangle while it should be only red.
Additional InformationLazarus 1.3 r46204M FPC 2.7.1 x86_64-linux-qt
TagsNo tags attached.
Fixed in Revision46282
LazTarget1.2.6
WidgetsetQT
Attached Files

Relationships

related to 0026004 closedZeljan Rikalo CopyRect+InvalidateRect issue [Qt] 
has duplicate 0026745 closedZeljan Rikalo [Qt] CopyRect - regression of 26004 

Activities

Zeljan Rikalo

2014-09-21 12:19

developer   ~0077481

Seem like Qt version related. Here with 4.7.4 32bit it looks good. What's your qt version ?

Vojtech Cihak

2014-09-21 13:07

reporter   ~0077483

My Qt is 64-bit, 4.8.6.
KDE is 4.14.1.

Zeljan Rikalo

2014-09-21 13:09

developer   ~0077484

Just tested on my laptop with Fedora 19 64bit Qt-4.8.6 and yes, issue is present.
Now must find at least 4.8.5 somewhere and check against it,or pass through changes log of Qt to see where they touched clipping.

Zeljan Rikalo

2014-09-21 13:13

developer   ~0077485

Bug exists only with -graphicssystem raster (which is default on modern distros), with -graphicssystem native it looks good.Can reproduce with 4.7.4 too.

Zeljan Rikalo

2014-09-21 13:13

developer   ~0077486

Setted up laztarget to 1.2.6

Zeljan Rikalo

2014-09-21 14:10

developer  

qt_rasterengine_clip_bug.diff (1,745 bytes)   
Index: lcl/interfaces/qt/qtwinapi.inc
===================================================================
--- lcl/interfaces/qt/qtwinapi.inc	(revision 46270)
+++ lcl/interfaces/qt/qtwinapi.inc	(working copy)
@@ -6649,14 +6649,22 @@
         begin
           AClipRect := DstQDC.getClipRegion.getBoundingRect;
           OffsetRect(AClipRect, -AClipRect.Left, -AClipRect.Top);
+
           if (DstRect.Right - DstRect.Left <= AClipRect.Right) and
             (DstRect.Bottom - DstRect.Top <= AClipRect.Bottom) and
-            DstQDC.getClipRegion.containsPoint(DstRect.Left, DstRect.Top) and
-            // issue #26342, unset clipping only when transform is dirty
-            QPaintEngine_testDirty(DstQDC.PaintEngine, QPaintEngineDirtyTransform) then
+            DstQDC.getClipRegion.containsPoint(DstRect.Left, DstRect.Top) then
           begin
-            RestoreClip := True;
-            DstQDC.setClipping(False);
+            if (QPaintEngine_type(DstQDC.PaintEngine) = QPaintEngineRaster) then
+            begin
+              // issue #26744 - only affects raster engine.
+              RestoreClip := ((DstRect.Left > 0) or (DstRect.Top > 0)) and
+                (DstRect.Right - DstRect.Left - AClipRect.Right - AClipRect.Left = 0) and
+                (DstRect.Bottom - DstRect.Top - AClipRect.Bottom - AClipRect.Top = 0);
+            end else
+              // issue #26342, unset clipping only when transform is dirty with non raster engine.
+              RestoreClip := QPaintEngine_testDirty(DstQDC.PaintEngine, QPaintEngineDirtyTransform);
+            if RestoreClip then
+              DstQDC.setClipping(False);
           end;
         end;
         DstQDC.drawImage(@DstRect, Image, @SrcRect, QMask, @MaskRect);
qt_rasterengine_clip_bug.diff (1,745 bytes)   

Zeljan Rikalo

2014-09-21 14:11

developer   ~0077489

Please test with attached patch (if possible do heavy test with any example you have). If it's ok I'll commit.

Vojtech Cihak

2014-09-21 16:51

reporter   ~0077494

I applied path - works well. I tested with demo and with my TECRadioGroup and TECCheckGroup (these were components where I always notice this issue).

Zeljan Rikalo

2014-09-22 08:02

developer   ~0077514

Please test and close if ok.

Vojtech Cihak

2014-09-22 13:19

reporter   ~0077524

Tested with r.46287. Thanks.

Issue History

Date Modified Username Field Change
2014-09-19 15:14 Vojtech Cihak New Issue
2014-09-20 09:43 Juha Manninen Relationship added related to 0026004
2014-09-20 09:44 Juha Manninen Assigned To => Zeljan Rikalo
2014-09-20 09:44 Juha Manninen Status new => assigned
2014-09-21 12:16 Zeljan Rikalo Relationship added has duplicate 0026745
2014-09-21 12:19 Zeljan Rikalo LazTarget => -
2014-09-21 12:19 Zeljan Rikalo Note Added: 0077481
2014-09-21 12:19 Zeljan Rikalo Status assigned => feedback
2014-09-21 13:07 Vojtech Cihak Note Added: 0077483
2014-09-21 13:07 Vojtech Cihak Status feedback => assigned
2014-09-21 13:09 Zeljan Rikalo Note Added: 0077484
2014-09-21 13:09 Zeljan Rikalo Status assigned => confirmed
2014-09-21 13:13 Zeljan Rikalo Note Added: 0077485
2014-09-21 13:13 Zeljan Rikalo Status confirmed => feedback
2014-09-21 13:13 Zeljan Rikalo LazTarget - => 1.2.6
2014-09-21 13:13 Zeljan Rikalo Note Added: 0077486
2014-09-21 13:13 Zeljan Rikalo Status feedback => assigned
2014-09-21 13:13 Zeljan Rikalo Target Version => 1.2.6
2014-09-21 14:10 Zeljan Rikalo File Added: qt_rasterengine_clip_bug.diff
2014-09-21 14:11 Zeljan Rikalo Note Added: 0077489
2014-09-21 14:11 Zeljan Rikalo Status assigned => feedback
2014-09-21 16:51 Vojtech Cihak Note Added: 0077494
2014-09-21 16:51 Vojtech Cihak Status feedback => assigned
2014-09-22 08:02 Zeljan Rikalo Fixed in Revision => 46282
2014-09-22 08:02 Zeljan Rikalo Note Added: 0077514
2014-09-22 08:02 Zeljan Rikalo Status assigned => resolved
2014-09-22 08:02 Zeljan Rikalo Resolution open => fixed
2014-09-22 13:19 Vojtech Cihak Note Added: 0077524
2014-09-22 13:19 Vojtech Cihak Status resolved => closed