[Marble-devel] PyQt and Marble Python bindings
Yann Goudard
marble at alleeduweb.eu
Thu Jun 24 17:44:47 CEST 2010
Hi,
On 06/23/2010 10:51 PM, Simon Edwards wrote:
> 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 *
I cannot import marble from PyKDE4. Even if I have no error reported by
compilation, I do not see anything indicating that a Python module has
been created.
>
> 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.)
I also tried to produce GUI with pykdeuic4 but it failed with the same
error. Moreover I am not really interested in having KDE libs included
in my app. I aim to produce a portable executable for both Linux and MS
Windows. I have read that Marble does not rely on KDE so we should be
able to get MarbleWidget and pyuic4 working together.
>
> 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,
>
Maybe it will help if you know I am compiling from Marble 0.8.0
downloaded from http://edu.kde.org/marble/download.php .
Regards,
Yann Goudard
More information about the Marble-devel
mailing list