[Qt] Qt bindings problem (pretty urgent)

zeljko zeljko at holobit.net
Tue Apr 27 21:25:32 CEST 2010


On Tuesday 27 April 2010 21:20, Den Jean wrote:
> On Tuesday 27 April 2010 18:23:34 zeljko wrote:
> > I don't understand what you want to say.
> >
> :-) idem dito
> :
> > Are you saying that our rect
> > conversion is ok ? (I don't care for +1 -1 at the moment).
>
> I was explaining how Qt class qrect is used in binding. By using a
> pascal record with the same binary layout as the QRect Qt Class.
> Only when a qrect is returned by any qt call, the binding first
> calls the copy...rect... functions to fix for the +1/-1 and different OsX
> binary layout.
> If you use the topleft (and other functions of qrect), they
> return the coordinates in the struct/record (w/o the +1/-1).
> In most cases this is what you want.

I don't use any function of QRect I'm using QWidget_rect() from bindings which 
returns PRect , which comes from CopyQRectToPRect() and that one doesnt 
assign any value to PRect^.TopLeft. In case of QWidget_rect() QRect.topLeft() 
is filled with viewport offset.
Better ? :)

>
> > 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 am not sure what you mean by qt code and qt binding.
> perhaps you should adapt a small fpc qt4 demo and add
>  some code that demoes your problem.
>
> > I'll try to add it to bindings just to see if it works.
>
> _______________________________________________
> Qt mailing list
> Qt at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/qt




More information about the Qt mailing list