[PyKDE] Another problem with custom widgets and pyuic4
Andreas Pakulat
apaku at gmx.de
Mon Jan 16 18:44:02 GMT 2006
On 16.01.06 18:17:18, Torsten Marek wrote:
> Andreas Pakulat schrieb:
> > Hi,
> >
> > Torsten this is for you:
> >
> > There is a problem setting various parameters on custom widgets, for
> > example changing the sizePolicy in designer for a custom widget results
> > in pyuic4 failing to generate the code with:
> >
>
> even if it might sound ironically: the problem lies in your custom widget patch
:-) There should be a post from me, answering to my own mail when you
read this. Unfortunately I was without network in the meantime. I
changed QObject to QWidget and also cc'ed Phil so it'll hopefully get
into the next snapshot he releases..
> BTW, how do you manage to get these classes anyway? I can't find that
> in Qt Designer, all I know is the "promote to custom widget" function.
You probably missed that this is from porting a C++ application of mine
to python so that I have it in the same language as the HTML-Parser I'm
going to use. Thus, the .ui files were created by using a
custom-widget-library for qt designer. When I started porting, I just
copied over the .ui's made pyuic4 generate code that I can work with and
now all I have to do is reimplement the widget classes in Python and use
the Ui_<blah> from there. Works pretty well so far.
> Technical details follow:
Didn't read that as I have no idea about all this metaclass/type-stuff
from python which you're using.
> If all the talking about proxy objects make your head buzz and you ask yourself
> why this is necessary, just consider that both UI loader and compiler share most
> of the code. Of the ~920 SLOCS, only 325 are special to the compiler and 43 to
> the loader.
>From what I have understood and from what I saw, all this proxy-objects
stuff is pretty good in writing the same thing with less code. If you
compare your uic to the one shipped with Qt4.1 just by lines of code you
decreased it from 15000 to 1113. Though there may be more stuff that the
real uic does.
Andreas
--
You will soon meet a person who will play an important role in your life.
More information about the PyQt
mailing list