[PyQt] Handling PyQT/PyKDE4 on ARM

Michael Casadevall sonicmctails at gmail.com
Sun Dec 14 22:18:29 GMT 2008


On Sun, Dec 14, 2008 at 5:10 PM, David Boddie <david at boddie.org.uk> wrote:
> On Sun Dec 14 20:47:06 GMT 2008, Michael Casadevall wrote:
>
>> Internally, PyQT4 uses qreals in its bindings for QLists, and so
>> forth. Although this works fine when qreal is a double since a float
>> will be converted implicatively, when it is a float, it looses the
>> ability to handle doubles since float is smaller than double. I
>> believe the solution is to remove explicate qreals, and handle both
>> float and double separately.
>
> It's been a while since I did anything with this, but maybe you could
> take a look at these rough-and-ready patches for PyQt 4.3:
>
> http://www.diotavelli.net/PyQtWiki/PyQt4_on_the_Qtopia_Greenphone
> http://chaos.troll.no/~dboddie/Python/Greenphone/
>

Oooh, very handy, I'll be looking into this.

> What I did was to add checks for a PyQt "feature" called PyQt_FPU
> which used MappedType declarations for double if enabled, or float
> if disabled, for QList at least.
>
> So, much the same as you describe, except that I continued to use qreal
> in declarations because it should be appropriately defined, anyway.
> Oh, and the patches also contain lots of other Features because I was
> using Qtopia Core (as it used to be known) instead of Qt on X11.
>
>> Secondly, in some cases, sip tries to pass double points into qreals,
>> which breaks miserably on ARM. This happens when building plasma's
>> bindings. This happens when building a widget derived from
>> QGraphicsView, and that widget hasn't overridden getContetMargins.
>> getContentMargins accepts four qreal pointers, and sip tries to pass
>> in four double ones. I can provide the generated code in this
>> instance.
>
> I think you'll just have to handle this in the same way as for QList and
> friends.
>
No, this is a C problem with the generated code. Essentially

(this assumes qreal is float)

double * a;
qreal * b;

a = b;

Which fails because there is no explicate cast.
- Hide quoted text -

>> I can provide access to relatively fast ARM hardware to help handle
>> porting work and so forth, if anyone is interested in working on
>> resolving this issue.
>
> Having spent a fair amount of my own time on this sort of thing, I'd love to
> be able to help but, sadly, I just don't have the time these days. I don't
> mind sharing experiences and testing things, though, so feel free to let me
> know how things are progressing.
>
> David
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>

On Sun, Dec 14, 2008 at 5:10 PM, David Boddie <david at boddie.org.uk> wrote:
> On Sun Dec 14 20:47:06 GMT 2008, Michael Casadevall wrote:
>
>> Internally, PyQT4 uses qreals in its bindings for QLists, and so
>> forth. Although this works fine when qreal is a double since a float
>> will be converted implicatively, when it is a float, it looses the
>> ability to handle doubles since float is smaller than double. I
>> believe the solution is to remove explicate qreals, and handle both
>> float and double separately.
>
> It's been a while since I did anything with this, but maybe you could
> take a look at these rough-and-ready patches for PyQt 4.3:
>
> http://www.diotavelli.net/PyQtWiki/PyQt4_on_the_Qtopia_Greenphone
> http://chaos.troll.no/~dboddie/Python/Greenphone/
>
> What I did was to add checks for a PyQt "feature" called PyQt_FPU
> which used MappedType declarations for double if enabled, or float
> if disabled, for QList at least.
>
> So, much the same as you describe, except that I continued to use qreal
> in declarations because it should be appropriately defined, anyway.
> Oh, and the patches also contain lots of other Features because I was
> using Qtopia Core (as it used to be known) instead of Qt on X11.
>
>> Secondly, in some cases, sip tries to pass double points into qreals,
>> which breaks miserably on ARM. This happens when building plasma's
>> bindings. This happens when building a widget derived from
>> QGraphicsView, and that widget hasn't overridden getContetMargins.
>> getContentMargins accepts four qreal pointers, and sip tries to pass
>> in four double ones. I can provide the generated code in this
>> instance.
>
> I think you'll just have to handle this in the same way as for QList and
> friends.
>
>> I can provide access to relatively fast ARM hardware to help handle
>> porting work and so forth, if anyone is interested in working on
>> resolving this issue.
>
> Having spent a fair amount of my own time on this sort of thing, I'd love to
> be able to help but, sadly, I just don't have the time these days. I don't
> mind sharing experiences and testing things, though, so feel free to let me
> know how things are progressing.
>
> David
> _______________________________________________
> PyQt mailing list    PyQt at riverbankcomputing.com
> http://www.riverbankcomputing.com/mailman/listinfo/pyqt
>


More information about the PyQt mailing list