[PyQt] Cross Compiled PYQT

David Boddie david at boddie.org.uk
Thu Apr 17 23:22:36 BST 2008

On Sat, 12 Apr 2008 10:13:03 +0200, Aaron Digulla wrote:

> Hal Glenn schrieb:

> > OK, I ended up following David's example completely, at first we had
> > tried with newer versions of Python QT sip etc but each one possessed a
> > problem so we dropped back to using David's work almost word for word,
> > accept in order to cross compile Python we had to edit it's Makefile
> > slightly to build the correct architecture python libs.

The patches need to be updated to the latest versions - not something I
have time for right now, unfortunately. :-(

> > One we had all
> > that done, we copied the tree over to our device (gumstix) and ran a few
> > tests on QT and Python. Both seemed to be working fine.
> >
> > But once we started trying to looking PYQT we got a Seg fault... don't
> > suppose any of you know what this means? besides it's broke :)
> >
> > root at gumstix-custom-verdex:~/inclinometer$ /qtopia/bin/python
> > Python 2.4.4 (#4, Apr 11 2008, 14:25:03)
> > [GCC 4.1.2] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> >
> >>>> from PyQt4 import  QtGui
> >>>> a = QtGui.QApplication(['',"-qws"])
> >>>> w = QtGui.QWidget()
> >>>> w.show()
> >
> > QPaintDevice::metrics: Device has no metric information
> > Unrecognised metric -1095300876!

I hate this kind of error. I'm sure I've seen it before. :-(

> See
> http://www.koders.com/cpp/fid5E72FF127FF66330C902165EB46C14C3BA824BD6.aspx?
>s=mdef%3Ainsert for the source code which prints the line. My guess is that
> the wrong QPaintDevice is used, that is one which doesn't implement
> metric() or maybe overloading doesn't work correctly.

I think you're on the right track. Maybe the -qws option is not being
passed through to the QApplication constructor correctly, in which case
I'd pass QApplication.GuiServer as the second argument. Or perhaps, just
speculating, the event loop needs to be started.

Have you (Hal) tried creating and running a simple example rather than trying
things in an interactive session?


More information about the PyQt mailing list