Sign in Join

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

Mailing lists / qt / 2010-02

QPointFH

7 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

zeljko

Hi all,

QPointFH is needed by few dozen of routines inside qt4.pas, but there's no way of use those routines since qpointfh isn't implemented, so those routines are also unuseable.
Den, can you add it and repack new 2.XXX bindings (also don't forget to add qt version) ?

tnx

zeljko

Den Jean
to zeljko
zeljko wrote 6 lines
QPointFH is needed by few dozen of routines inside qt4.pas, but there's no way of use those routines since qpointfh isn't implemented, so those routines are also unuseable. Den, can you add it and repack new 2.XXX bindings (also don't forget to add qt version) ?

try 2.1RC, will make release after feedback.

Version V2.1:
- QPointF support
* via new Pascal types: TQtPointF,PQtPointF and convenience function QtPointF (like QtPoint)
* the pascal record TQtPointF is compatible with QPointF internal representation.
* http://wiki.freepascal.org/Qt4_binding#Solution:Pascalify

- new QtVersion function (returns qVersion:http://doc.qt.nokia.com/4.5/qtglobal.html#qVersion)

Download urls (temporarily):
http://users.telenet.be/Jan.Van.hijfte/qtforfpc/qt4pas-V2.1RC_Qt4.5.3.tar.gz http://users.telenet.be/Jan.Van.hijfte/qtforfpc/bin-qt4pas-V2.1RC_Qt4.5.3.tar.gz http://users.telenet.be/Jan.Van.hijfte/qtforfpc/demos-V2.1RC_Qt4.5.3.tar.gz

Changes for Lazarus:

you will need this one line change.

--- qtwinapi.inc        (revision 23707)
+++ qtwinapi.inc        (working copy)
@@ -1178,7 +1178,7 @@
       QTransform_inverted(Matrix, MatrixInv, @Inverted);
       QtPoint.X := P^.X;
       QtPoint.Y := P^.Y;
-      QTransform_map(MatrixInv, @QtPoint, @QtPoint);
+      QTransform_map(MatrixInv, PQtPoint(@QtPoint), PQtPoint(@QtPoint));
       P^.X := QtPoint.X;
       P^.Y := QtPoint.Y;
       Inc(P);

regards,

Den Jean

zeljko
to Den Jean
Den Jean wrote 19 lines
try 2.1RC, will make release after feedback. Version V2.1: - QPointF support * via new Pascal types: TQtPointF,PQtPointF and convenience function QtPointF (like QtPoint) * the pascal record TQtPointF is compatible with QPointF internal representation. * http://wiki.freepascal.org/Qt4_binding#Solution:Pascalify - new QtVersion function (returns qVersion:http://doc.qt.nokia.com/4.5/qtglobal.html#qVersion) Download urls (temporarily): http://users.telenet.be/Jan.Van.hijfte/qtforfpc/qt4pas-V2.1RC_Qt4.5.3.tar.g z http://users.telenet.be/Jan.Van.hijfte/qtforfpc/bin-qt4pas-V2.1RC_Qt4.5.3.t ar.gz http://users.telenet.be/Jan.Van.hijfte/qtforfpc/demos-V2.1RC_Qt4.5.3.tar.gz

Great news ! thanks Den :)

Show quoted text 15 lines
Changes for Lazarus: you will need this one line change. --- qtwinapi.inc (revision 23707) +++ qtwinapi.inc (working copy) @@ -1178,7 +1178,7 @@ QTransform_inverted(Matrix, MatrixInv, @Inverted); QtPoint.X := P^.X; QtPoint.Y := P^.Y; - QTransform_map(MatrixInv, @QtPoint, @QtPoint); + QTransform_map(MatrixInv, PQtPoint(@QtPoint), PQtPoint(@QtPoint)); P^.X := QtPoint.X; P^.Y := QtPoint.Y; Inc(P);

This changes in winapi must be applied with current 1.72, or it's 2.XX change only ?

zeljko

Den Jean
to zeljko
zeljko wrote
This changes in winapi must be applied with current 1.72, or it's 2.XX change only ?

It is for >= 2.1 due to addition of QPointF
(creates ambiguity between overloaded procedures when using @ operator instead of PQtPointX variable)

fpc will give compile error: Error: Can't determine which overloaded function to call

procedure QTransform_map(handle: QTransformH; retval: PQtPoint; p: PQtPoint); overload; cdecl; external Qt4PasLib name 'QTransform_map';
procedure QTransform_map(handle: QTransformH; retval: PQtPointF; p: PQtPointF); overload; cdecl; external Qt4PasLib name 'QTransform_map2';

but you can already add the code now when still using 1.72 (no need for ifdef stuff)

regards,

Den Jean

Vincent Snijders
to Den Jean
Den Jean wrote 15 lines
On Tuesday 16 February 2010 08:14:24 zeljko wrote: > This changes in winapi must be applied with current 1.72, or it's 2.XX > change only ? It is for >= 2.1 due to addition of QPointF (creates ambiguity between overloaded procedures when using @ operator instead of PQtPointX variable) fpc will give compile error: Error: Can't determine which overloaded function to call procedure QTransform_map(handle: QTransformH; retval: PQtPoint; p: PQtPoint); overload; cdecl; external Qt4PasLib name 'QTransform_map'; procedure QTransform_map(handle: QTransformH; retval: PQtPointF; p: PQtPointF); overload; cdecl; external Qt4PasLib name 'QTransform_map2'; but you can already add the code now when still using 1.72 (no need for ifdef stuff)

Can't you use {$T+} to reduce the ambiguity?

Vincent

Den Jean
to Vincent Snijders
Vincent Snijders wrote
Can't you use {$T+} to reduce the ambiguity?

yes, but it breaks other code.
I like pascal type safety, so would I prefer all
code to be {$T+} compatible, but with a thin c-binding like this one, some type troubles are normal

e.g:
function QPolygon_create(nPoints: Integer; points: PInteger): QPolygonH; cdecl; http://doc.trolltech.com/4.5/qpolygon.html#QPolygon-4 expects actually an array of records {x,y:integer}

procedure QWidget_actions(handle: QWidgetH; retval: PPtrIntArray); cdecl; http://doc.trolltech.com/4.5/qwidget.html#actions
all QList<SomeQtClassType *> are replaced with the same PPtrIntArray type by binding, For {$T+} code I would need to add a type for each QList_Type. (perhaps some day :-)

regards,

Den Jean

zeljko
to Den Jean: try 2.1RC, will make release after feedback. Version V2.1: - QPointF support * via new…
Den Jean wrote 8 lines
On Tuesday 02 February 2010 08:20:10 zeljko wrote: > QPointFH is needed by few dozen of routines inside qt4.pas, but there's > no way of use those routines since qpointfh isn't implemented, so those > routines are also unuseable. > Den, can you add it and repack new 2.XXX bindings (also don't forget to > add qt version) ? try 2.1RC, will make release after feedback.

You can release 2.1

zeljko