[Qt] About bug in GetClientBounds that leads to incorrect InvalidateRect behavior

Luiz Americo Pereira Camara luizmed at oi.com.br
Wed Apr 2 00:38:05 CEST 2008


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-ide.org/pipermail/qt/attachments/20080401/d8e5548f/attachment-0001.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-ide.org/pipermail/qt/attachments/20080401/d8e5548f/attachment-0001.bin>


More information about the Qt mailing list