View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0036879 | Lazarus | LCL | public | 2020-04-06 16:17 | 2020-04-08 20:15 |
Reporter | CudaText man | Assigned To | Zeljan Rikalo | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | no change required | ||
OS | ubuntu 19.x x64 | ||||
Product Version | 2.0.7 (SVN) | ||||
Summary | 0036879: Qt/Qt5 bad Canvas.StretchDraw | ||||
Description | after last changes in qt/qt5 WS, ATTabs component cannot paint angled tabs. to see - install ATFlatControls from IDE online package manager / or from https://github.com/alexey-t/atflatcontrols - run app/demo_tabs with qt/Qt5 pic added. | ||||
Tags | No tags attached. | ||||
Fixed in Revision | |||||
LazTarget | - | ||||
Widgetset | QT, QT5 | ||||
Attached Files |
|
|
|
|
I've already written to the mailing list: please create simple example project so I don't need to install 3rd party components like ATxxxxx controls. |
|
I've tested with svn r60000 (only qt/qt5 widgetset part) (4.1.2019, so 15 months ago) and same problem persists with qt and qt5, so this has nothing to do with my recent changes with stretchMaskBlt(). (linux mint 19.2 64bit, Qt/Qt5). Does your code work ok with cocoa ? |
|
i've seen ATTabs code and see it paints triangle over old triangle. trinagle-1 overlaps trinagle-2. so 2 nearest tabs overlap. code gets old rect using Canvas.CopyRect, paints triangle over it. maybe CopyRect has bug. |
|
yes, code works ok with Cocoa. and with old Laz 2.1 with qt/qt5. |
|
@CudaText man, now with my internal changes in CopyRect() (TQtWidgetSet.StretchMaskBlt()) I have ok image, but problem is that background is black, but under gtk2 it's transparent, so it does not look ok yet. |
|
ok, waiting for qt/qt5 fixing. |
|
I've lost few hours because trusted in your code. You are painting outside of paint event somewhere in your code and using CopyRect() (or BitBlt, StretchBlt or StretchmaskBlt). Qt, Qt5, cocoa and carbon does not support painting outside of paint event. This is my error log (only TATabs with 2 tabs are on the form). It's clear here that you're copying something from TCustomcontrol to DestDC which is TBitmap in this case, but not inside paint event of TCustomControl. ERROR: SrcDC NOT inside paintEvent...TQtViewPort FOwner TQtCustomControl LCLObject=ATTabs1:TATTabs SrcRect=l=334,t=4,r=344,b=28 DstRect=l=0,t=0,r=50,b=120 destination is QImage with format QImageFormat_RGB32 ERROR: SrcDC NOT inside paintEvent...TQtViewPort FOwner TQtCustomControl LCLObject=ATTabs1:TATTabs SrcRect=l=168,t=4,r=178,b=28 DstRect=l=0,t=0,r=50,b=120 destination is QImage with format QImageFormat_RGB32 ERROR: SrcDC NOT inside paintEvent...TQtViewPort FOwner TQtCustomControl LCLObject=ATTabs1:TATTabs SrcRect=l=306,t=4,r=316,b=28 DstRect=l=0,t=0,r=50,b=120 destination is QImage with format QImageFormat_RGB32 ERROR: SrcDC NOT inside paintEvent...TQtViewPort FOwner TQtCustomControl LCLObject=ATTabs1:TATTabs SrcRect=l=38,t=4,r=48,b=29 DstRect=l=0,t=0,r=50,b=125 destination is QImage with format QImageFormat_RGB32 ERROR: SrcDC NOT inside paintEvent...TQtViewPort FOwner TQtCustomControl LCLObject=ATTabs1:TATTabs SrcRect=l=176,t=4,r=186,b=29 DstRect=l=0,t=0,r=50,b=125 destination is QImage with format QImageFormat_RGB32 Resolved as "no change required". Fix your code. |
|
Sorry, it was fault inside my debugging code. ATTabs does not paint outside of paint event |
|
It looks to me that you're missing mask on bitmap. Note that copy from screen is much different under X11 than windows. If your window is obscured by some other window it won't work as expected. Currently (in my trunk copy) I've hacked & cheated Qt to render widget (as in TQtWSWinControl.PaintTo()) instead of grabbing window and got result as in attached picture. Triangles are there but they're not masked so you see white stuff around. |
|
Ok, I've found howto fix it inside ATTabs. CopyRect() from device isn't needed at all (it does exactly nothing). 1.Rename FBitmapAngle to FBitmapAngleL 2.Add FBitmapAngleR (create it same as FBitmapAngleL) 3.In DoPaintTabShape_R() use FBitmapAngleR instead of FBitmapAngleL. 4.In DrawTriangleRectFramed() add this: BitmapSetSize(b, ASizeX*AScale, ASizeY*AScale); // add this b.Canvas.Brush.Style := bsSolid; b.Canvas.Brush.Color := {$IFDEF MSWINDOWS}clWhite{$ELSE}clBlack{$ENDIF}; b.Canvas.FillRect(0, 0, b.Width, b.Height); b.TransparentColor := {$IFDEF MSWINDOWS}clWhite{$ELSE}clBlack{$ENDIF}; b.Transparent := true; 5.Remove below b.Canvas.CopyRect() . Now your code will be even faster (at least under X11) and it will work correct. |
|
See results in pictures. All are ok (except gtk3 but that's anothers story since gtk3 drawing isn't perfect yet). EDIT: All screenshoots are maded after changes I've proposed. |
|
thanks for your fix. i added this fix to ATtabs. |
|
Please close if ok. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-04-06 16:17 | CudaText man | New Issue | |
2020-04-06 16:17 | CudaText man | File Added: tabz.png | |
2020-04-06 16:22 | Zeljan Rikalo | Assigned To | => Zeljan Rikalo |
2020-04-06 16:22 | Zeljan Rikalo | Status | new => assigned |
2020-04-06 16:22 | Zeljan Rikalo | LazTarget | => - |
2020-04-06 16:22 | Zeljan Rikalo | Note Added: 0121972 | |
2020-04-06 17:22 | Zeljan Rikalo | Status | assigned => feedback |
2020-04-06 17:22 | Zeljan Rikalo | Note Added: 0121975 | |
2020-04-06 22:40 | CudaText man | Note Added: 0121988 | |
2020-04-06 22:40 | CudaText man | Status | feedback => assigned |
2020-04-06 22:40 | CudaText man | Note Added: 0121989 | |
2020-04-06 22:41 | CudaText man | Note Edited: 0121988 | View Revisions |
2020-04-07 11:03 | Zeljan Rikalo | Note Added: 0121996 | |
2020-04-07 19:36 | CudaText man | Note Added: 0122008 | |
2020-04-07 21:28 | Zeljan Rikalo | Status | assigned => resolved |
2020-04-07 21:28 | Zeljan Rikalo | Resolution | open => no change required |
2020-04-07 21:28 | Zeljan Rikalo | Widgetset | QT, QT5 => QT, QT5 |
2020-04-07 21:28 | Zeljan Rikalo | Note Added: 0122009 | |
2020-04-08 09:25 | Zeljan Rikalo | Status | resolved => acknowledged |
2020-04-08 09:25 | Zeljan Rikalo | Resolution | no change required => reopened |
2020-04-08 09:25 | Zeljan Rikalo | Note Added: 0122014 | |
2020-04-08 09:27 | Zeljan Rikalo | File Added: attabs_missing_mask.png | |
2020-04-08 09:27 | Zeljan Rikalo | Note Added: 0122015 | |
2020-04-08 12:21 | Zeljan Rikalo | Status | acknowledged => feedback |
2020-04-08 12:21 | Zeljan Rikalo | Note Added: 0122025 | |
2020-04-08 12:26 | Zeljan Rikalo | File Added: attabs_gtk3.png | |
2020-04-08 12:26 | Zeljan Rikalo | File Added: attabs_win32_under_wine.png | |
2020-04-08 12:26 | Zeljan Rikalo | File Added: attabs_gtk2.png | |
2020-04-08 12:26 | Zeljan Rikalo | File Added: attabs_qt5.png | |
2020-04-08 12:26 | Zeljan Rikalo | File Added: attabs_qt4.png | |
2020-04-08 12:26 | Zeljan Rikalo | Note Added: 0122027 | |
2020-04-08 12:26 | Zeljan Rikalo | Note Edited: 0122027 | View Revisions |
2020-04-08 20:02 | CudaText man | Note Added: 0122039 | |
2020-04-08 20:02 | CudaText man | Status | feedback => assigned |
2020-04-08 20:15 | Zeljan Rikalo | Status | assigned => resolved |
2020-04-08 20:15 | Zeljan Rikalo | Resolution | reopened => no change required |
2020-04-08 20:15 | Zeljan Rikalo | Widgetset | QT, QT5 => QT, QT5 |
2020-04-08 20:15 | Zeljan Rikalo | Note Added: 0122040 |