Sign in Join

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

Mailing lists / qt / 2008-06

qt tshapes arm]

9 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

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

Terry Kemp
Show quoted text 14 lines
Maybe some fpc troubles? We are calling translate so: TQtDeviceContext(DC).translate(P.X, P.Y); where P.X and P.Y are integers but translate arguments are doubles. So maybe fpc wrongly converts integers to double? Can you check what do you get in TQtDeviceContext.translate. I mean arguments dx and dy. Btw, what fpc version do you use? Best regards, Paul Ishenin.

OK, I will check the translate args.
here it is... all OK

[WinAPI SetWindowOrgEx] DC: 40F91380 NewX: -62 NewY: -1 integer = 4
pointer = 4
cardinal = 4
[WinAPI SetWindowOrgEx] MATRIX dx: 4.05437852603306E-308 [WinAPI SetWindowOrgEx] MATRIX dy: 4.05437905653200E-308 [WinAPI SetWindowOrgEx] MATRIX m11: 4.05437905238748E-308 [WinAPI SetWindowOrgEx] MATRIX m12: 4.05437852603306E-308 [WinAPI SetWindowOrgEx] MATRIX m21: 4.05437852603306E-308 [WinAPI SetWindowOrgEx] MATRIX m22: 4.05437905238748E-308 Trace: > [WinAPI GetWindowOrgEx]
Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DX 4.04931968806739E-308 Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DY4.06088085163552E-308 Trace: < [WinAPI GetWindowOrgEx] Result=(x=0,y=0)
[WinAPI SetWindowOrgEx] DC: 40F91380 P.X: 0 P.Y: 0 [WinAPI SetWindowOrgEx] OldPoint: -4133068C
TQtDeviceContext.drawRect() x1: 62 y1: 1 w: 10 h: 10 TQtDeviceContext.translate() dx: 6.20000000000000E+001 dy: 1.00000000000000E+000 TQtDeviceContext.drawRect() x1: 0 y1: 0 w: 12 h: 12 ***** [WinAPI TQtWidgetSet.IntersectClipRect]
Trace:> [WinAPI SelectObject] DC=40F91380 GDIObj=40EEAE40 TQtDeviceContext.pen() TQtDeviceContext.setPen() TQtDeviceContext.pen() Trace:< [WinAPI SelectObject] Result=40EEA900 ObjectType=Pen [WinAPI MoveToEx] DC:40F91380 X:0 Y:0

I'm compiling the lazarus project with latest svn
fpc-arm-2.3.1 (softfloat eabi)

This is the only problem I have.

It still seems strange the calls to matrix_dy etc return crazy (float) numbers. I will see what they are in hex. there is a pattern there.

thanks again

Terry

Terry Kemp
to Terry Kemp
Terry Kemp wrote 15 lines
> > Maybe some fpc troubles? We are calling translate so: > > TQtDeviceContext(DC).translate(P.X, P.Y); > > where P.X and P.Y are integers but translate arguments are doubles. So > maybe fpc wrongly converts integers to double? Can you check what do you > get in TQtDeviceContext.translate. I mean arguments dx and dy. > > Btw, what fpc version do you use? > > Best regards, > Paul Ishenin. >

One last thing before I give up, move to the dark side and learn C++

I started looking at the bindings and wanted to see what qreal was. Me thinks this could be my problem...

typedef qreal
Typedef for double on all platforms except for those using CPUs with ARM architectures. On ARM-based platforms, qreal is a typedef for float for performance reasons.

Is this /easily/ changed in the bindings Den? or shall I manually go through and modify the calls to see if this works.

Thanks

Terry

Show quoted text 46 lines
OK, I will check the translate args. here it is... all OK [WinAPI SetWindowOrgEx] DC: 40F91380 NewX: -62 NewY: -1 integer = 4 pointer = 4 cardinal = 4 [WinAPI SetWindowOrgEx] MATRIX dx: 4.05437852603306E-308 [WinAPI SetWindowOrgEx] MATRIX dy: 4.05437905653200E-308 [WinAPI SetWindowOrgEx] MATRIX m11: 4.05437905238748E-308 [WinAPI SetWindowOrgEx] MATRIX m12: 4.05437852603306E-308 [WinAPI SetWindowOrgEx] MATRIX m21: 4.05437852603306E-308 [WinAPI SetWindowOrgEx] MATRIX m22: 4.05437905238748E-308 Trace: > [WinAPI GetWindowOrgEx] Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DX 4.04931968806739E-308 Trace: < [WinAPI GetWindowOrgEx] QMATRIX_DY4.06088085163552E-308 Trace: < [WinAPI GetWindowOrgEx] Result=(x=0,y=0) [WinAPI SetWindowOrgEx] DC: 40F91380 P.X: 0 P.Y: 0 [WinAPI SetWindowOrgEx] OldPoint: -4133068C TQtDeviceContext.drawRect() x1: 62 y1: 1 w: 10 h: 10 TQtDeviceContext.translate() dx: 6.20000000000000E+001 dy: 1.00000000000000E+000 TQtDeviceContext.drawRect() x1: 0 y1: 0 w: 12 h: 12 ***** [WinAPI TQtWidgetSet.IntersectClipRect] Trace:> [WinAPI SelectObject] DC=40F91380 GDIObj=40EEAE40 TQtDeviceContext.pen() TQtDeviceContext.setPen() TQtDeviceContext.pen() Trace:< [WinAPI SelectObject] Result=40EEA900 ObjectType=Pen [WinAPI MoveToEx] DC:40F91380 X:0 Y:0 I'm compiling the lazarus project with latest svn fpc-arm-2.3.1 (softfloat eabi) This is the only problem I have. It still seems strange the calls to matrix_dy etc return crazy (float) numbers. I will see what they are in hex. there is a pattern there. thanks again Terry _______________________________________________ Qt mailing list http://www.lazarus.freepascal.org/mailman/listinfo/qt
Den Jean
to Terry Kemp
Terry Kemp wrote
Is this /easily/ changed in the bindings Den? or shall I manually go through and modify the calls to see if this works.

will look into it

Terry Kemp
to Den Jean
Den Jean wrote 6 lines
On Thursday 19 June 2008 22:57:52 Terry Kemp wrote: > Is this /easily/ changed in the bindings Den? or shall I manually go > through and modify the calls to see if this works. will look into it

Thanks, if its not a simple change - i.e. don't spend too long on it - ?I am quite happy to work through it and submit my changes (assuming this fixes the problem of course).

I do understand that what I'm doing is completely unsupported at this time.

regards

Terry

Show quoted text 7 lines
_______________________________________________ Qt mailing list http://www.lazarus.freepascal.org/mailman/listinfo/qt
Den Jean
to Terry Kemp
Terry Kemp wrote
Thanks, if its not a simple change - i.e. don't spend too long on it -

for me the change is not too big, but the LCL people need to look into this.

before I replaced qreal with double
now you make me notice that qreal is actually defined as :

#if defined(QT_ARCH_ARM) || (defined(QT_ARCH_MIPS) && !defined(Q_OS_IRIX)) #define QT_NO_FPU
#endif

#if defined(QT_COORD_TYPE)
typedef QT_COORD_TYPE qreal;
#elif defined(QT_NO_FPU)
typedef float qreal;
#else
typedef double qreal;
#endif

So I need to keep qreal as a new type in pascal and define it according the architecture:

  {$ifdef CPUARM}
    QReal = Double;
  {$else}
    QReal = single;
  {$endif}

So here is a temp release, can everyone (LCL/Qt) see what compatiblity problems this creates ?

http://users.pandora.be/Jan.Van.hijfte/qtforfpc/qt4pas-V1.63_Qt4.3.4.tar.gz http://users.pandora.be/Jan.Van.hijfte/qtforfpc/bin-qt4pas-V1.63_Qt4.3.4.tar.gz http://users.pandora.be/Jan.Van.hijfte/qtforfpc/demos-V1.63_Qt4.3.4.tar.gz

Felipe Monteiro de Carvalho
to Den Jean
Den Jean wrote 8 lines
So I need to keep qreal as a new type in pascal and define it according the architecture: {$ifdef CPUARM} QReal = Double; {$else} QReal = single; {$endif}

Looking at the C code you posted I think you inverted it. i.e. it should be single on ARM and double elsewhere.

Felipe Monteiro de Carvalho
Terry Kemp
to Den Jean

YES! - that fixed it :)

thank you.

Terry

Den Jean wrote 17 lines