Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2008-04

About bug in GetClientBounds that leads to incorrect InvalidateRect behavior

5 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Luiz Americo Pereira Camara

I reported the cited bug, but i can't comment in bugtracker because i'm having troubles to access *.freepascal.org sites, so i'm commenting here.

I saw that a fix was committed, but i found a simpler fix.

The problem is that when getting the value from the TQtViewport.GetClientBounds the bounds margin are not computed by QWidget_contentsRect. Calling the TQtWidget.GetClientBounds directly, the bounds margin are computed.
But unlike TQtViewport.GetClientBounds, TQtWidget.GetClientBounds does not compute the scrollbars size (a bug reported by me also). There's no difference is both code except that when calling TQtViewport it uses the viewPort widget instead of the main widget.

The attached patch fixes both issues. Basically it removes some code making TCustomControl follows the same path as other TWinControl. It comments TQtViewPort.GetClientBounds since it does nothing.

The patch was created with a LCL version previous to the current commit (that can be discarded) so may have some conflicts because i can't access the svn server.

I'm also sending the application used to test.

Luiz
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed... Name: clientbounds.diff
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20080401/d8e5548f/attachment.ksh> -------------- next part --------------
A non-text attachment was scrubbed...
Name: BorderStyleQt.zip
Type: application/x-zip-compressed
Size: 5327 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20080401/d8e5548f/attachment.bin>

Reply by email

Paul Ishenin
to Luiz Americo Pereira Camara
Luiz Americo Pereira Camara wrote 21 lines
I reported the cited bug, but i can't comment in bugtracker because i'm having troubles to access *.freepascal.org sites, so i'm commenting here. I saw that a fix was committed, but i found a simpler fix. The problem is that when getting the value from the TQtViewport.GetClientBounds the bounds margin are not computed by QWidget_contentsRect. Calling the TQtWidget.GetClientBounds directly, the bounds margin are computed. But unlike TQtViewport.GetClientBounds, TQtWidget.GetClientBounds does not compute the scrollbars size (a bug reported by me also). There's no difference is both code except that when calling TQtViewport it uses the viewPort widget instead of the main widget. The attached patch fixes both issues. Basically it removes some code making TCustomControl follows the same path as other TWinControl. It comments TQtViewPort.GetClientBounds since it does nothing. The patch was created with a LCL version previous to the current commit (that can be discarded) so may have some conflicts because i can't access the svn server.

I cant remember what was the reason that code become splitted for TCustomControl. There was some problems with synedit or so. But I removed that split as you suggested and I dont see any problems. So I applied it in r14724 (but you get all responsibility if something will go wrong :) ).

Best regards,
Paul Ishenin.

Reply by email

Paul Ishenin
to zeljko: Seem that rect bug does not exist anymore. Paul , can you close it ? I cannot access…

zeljko ?????:

Show quoted text 10 lines
On Wednesday 02 April 2008 05:35, Paul Ishenin wrote: > Luiz Americo Pereira Camara wrote: > I cant remember what was the reason that code become splitted for > TCustomControl. There was some problems with synedit or so. But I > removed that split as you suggested and I dont see any problems. So I > applied it in r14724 (but you get all responsibility if something will > go wrong :) ). Seem that rect bug does not exist anymore. Paul , can you close it ? I cannot access bugtracker.

I already resolved it, but I will wait a bit while you close it yourself :)

Best regards,
Paul Ishenin.

Reply by email

zeljko
to Paul Ishenin: I cant remember what was the reason that code become splitted for TCustomControl. There…
Paul Ishenin wrote 6 lines
Luiz Americo Pereira Camara wrote: I cant remember what was the reason that code become splitted for TCustomControl. There was some problems with synedit or so. But I removed that split as you suggested and I dont see any problems. So I applied it in r14724 (but you get all responsibility if something will go wrong :) ).

Seem that rect bug does not exist anymore. Paul , can you close it ? I cannot access bugtracker.

zeljko

Reply by email

zeljko
to Paul Ishenin: zeljko ?????: I already resolved it, but I will wait a bit while you close it yourself :)…
Paul Ishenin wrote 13 lines
zeljko ?????: > On Wednesday 02 April 2008 05:35, Paul Ishenin wrote: >> Luiz Americo Pereira Camara wrote: >> I cant remember what was the reason that code become splitted for >> TCustomControl. There was some problems with synedit or so. But I >> removed that split as you suggested and I dont see any problems. So I >> applied it in r14724 (but you get all responsibility if something will >> go wrong :) ). > > Seem that rect bug does not exist anymore. Paul , can you close it ? I > cannot access bugtracker. I already resolved it, but I will wait a bit while you close it yourself :)

closed. (accessed via proxy .... arghhh ;) )

Reply by email