PyQt leaves C-code in python modules

Dave shuvit at 127.0.0.1
Wed Nov 5 08:06:56 EST 2003


"Phil Thompson" <phil at riverbankcomputing.co.uk> wrote in message
news:mailman.439.1067973360.702.python-list at python.org...
> On Tuesday 04 November 2003 6:45 pm, Dave wrote:
> > I'm having a strange problem with the pyqt-tools in the latest Debian
> > packages.  When I run
> > $ pyuic colortool.ui > colortool.py
> > Extracting init()
> > Extracting loadSettings()
> > Extracting saveSettings()
> > ...
> > it produces 'colortool.py' with python function headers, but the body of
> > the functions are still in C.  There are no error messages, just the
normal
> > log of "extracting" functions.
> >
[...]
> That's because the form includes embedded C++ code. There is nothing to
stop
> you embedding Python code (just ignore the C++ style function definition)
and
> it will be properly extracted.
>
> What pyuic doesn't do is look at the embedded code and try to work out if
it
> is Python or something else.

Oops.  Please ignore my previous post.  I misunderstood what Phil was
saying.  I see now what to do.  Just write Python code in the body of the
C++ stub functions ( leaving the outer { } in place ) , and pyuic will copy
that code verbatim into the body of the translated Python functions.
Excellent.

Many thanks.

-- Dave






More information about the Python-list mailing list