[Marble-devel] PyQt and Marble Python bindings

Simon Edwards simon at simonzone.com
Wed Jun 23 22:51:39 CEST 2010


Hello,

On 06/23/2010 12:24 PM, Yann Goudard wrote:
> I would like to use MarbleWidget in my Python application. I saw that
> was possible on this page:
> http://techbase.kde.org/Projects/Marble/MarblePython . So I read Marble
> documentation and some mail archives and compiled sources with:
> -DEXPERIMENTAL_PYTHON_BINDINGS=TRUE and -DQTONLY=TRUE. Everything seemed
> to work fine.

Good to hear.

> Following several HOW-TO, I managed to create a GUI with QtDesigner
> which contains a MarbleWidget. Then I tried to create Python interface
> with pyuic4 but it stopped on "Unknown Qt widget: Marble.MarbleWidget".
> Where am I wrong ?
 > After reading this thread
> http://mail.kde.org/pipermail/marble-devel/2010-April/000833.html , I
> don't know if it is even possible to get Python bindings.

If you were able to build and install it, then you didn't hit this kind 
of problem. You can test this by running Python and in its command line 
trying: from PyKDE4.marble import *

pyuic4 doesn't know what to do with KDE widgets. There is a little 
program in PyKDE called pykdeuic4 which does know about most KDE 
widgets, but not marble. (You could hack it to support marble. It is 
quite simple.)

The easiest way for you is probably to add an empty widget to your UI 
design and then in your python code replace it with an instance of the 
marble widget at run time.

There is also a small test program in the marble/examples/python 
directory in kdeedu which shows how to get a marble widget going.

cheers,

-- 
Simon Edwards             | KDE-NL, Guidance tools, Guarddog Firewall
simon at simonzone.com       | http://www.simonzone.com/software/
Nijmegen, The Netherlands | "ZooTV? You made the right choice."


More information about the Marble-devel mailing list