[Qt] 64 bit problems

Giulio Bernardi ugilio at hotmail.com
Fri Jul 27 19:40:28 CEST 2007


After some time I tried to compile lcl-qt on linux-amd64, and I got some
compilation errors.

Please remember that not all machines are 32 bit, so whenever you cast
handles, pointers and so on to integer types you shouldn't assume they
are 4 bytes large.
If you need to do such casts, use PtrInt/PtrUInt: they are signed/unsigned
integer types of the same size of pointers (so they are Integer/LongWord on
32 bit machines and Int64/QWord on 64 bit machines).

These are the errors I have:

qtcaret.pas(139,33) Error: Illegal type conversion: "DWord" to "QPixmapH"
qtcaret.pas(269,6) Error: Illegal type conversion: "QPixmapH" to "DWord"
qtcaret.pas(272,34) Error: Illegal type conversion: "QPixmapH" to "LongInt"

Explanation:

line 139, CreateCaret function:
ColorCaret is cardinal, so it cannot be cast to a QPixmapH on 64 bit 
machines.

line 269,272 TEmulatedCaret.CreateCaret method:
A QPixmapH is cast to a Cardinal.
A QPixmapH is cast to an Integer (moreover, CreateColorPixmap wants a 
Cardinal:
maybe CreateColorPixmap should be modified too to accept a PtrInt/PtrUint?)

I didn't provide a patch because I don't know qt-lcl internals and I don't 
want
to break things.

bye,
Giulio 




More information about the Qt mailing list