[Qt] Qt bindings problem (pretty urgent)

zeljko zeljko at holobit.net
Tue Apr 27 18:23:34 CEST 2010


On Tuesday 27 April 2010 11:24, Den Jean wrote:
> On Tuesday 27 April 2010 09:25:58 zeljko wrote:
> > Hi Den, we have problem with copyQRectToPRect() and copyPRectToQRect().
> > It does not set TopLeft() TopRight() values and vice versa.
>
> QRect stores internally everything in a private x1,y1,x2,y2.
>
> copyQRectToPRect() and copyPRectToQRect() does modify those.
>
> long ago, we decided to fix two problems:
>   - OsX different memory layout of QRect
>   - LCL vs Qt differences with respect to rectangles including or not
>     the right/bottom edge:
> http://wiki.freepascal.org/Qt4_binding#Solution:Pascalify
>
> TopLeft and TopRight are functions that use these x1,y1,x2,y2. So
> whatever is set, these functions will return that, but these functions
> will not additionally modify with +1 or -1. (they return what is in QRect)

TopRight() is wrong (type),  it's bottomRight().

I don't understand what you want to say. Are you saying that our rect 
conversion is ok ? (I don't care for +1 -1 at the moment).
QAbstractScrollArea->viewport() uses TopLeft for information about viewport 
origin when we ask QWidget_rect(viewport, @R);
When we move scrollbar , viewport moves, QWidget_rect() is always same, but 
viewport is changing QRect topLeft value (according to qt code).

If we move viewport (eg. by scrolling) qt code says that TopLeft = (0, -20) in 
qt bindings it says TopLeft = (0,0).
I'll try to add it to bindings just to see if it works.

zeljko




More information about the Qt mailing list