[PyKDE] problem with icon image handling in designer
Hans-Peter Jansen
hpj at urpla.net
Wed Oct 15 16:30:00 BST 2003
Hi,
I'm trying to make use of an init() function, defined in designer, in
order to feed the default mime image factory with some images. I want
to circumvent designers image inlining function, since it fails to
handle transparency correctly, bloats ui/py files, and is generally
unflexible. On the other hand, loading lots of small images on every
startup isn't appealing, either. Thus, I've adapted a tool, found in
the wxPython dist., that merge images (and data) files into one
module, to my needs: look for img2pyqt in the attached tar ball.
Now this provides a factory function, which adds all images to the
default mime source factory. In order to be able to test designers ui
files out of the box, it would be necessary to call this function,
before the ui class is created, or just near the top of __init__ of
it (before image access), but after creating QApplication().
Designer provides 2 types of methods: slots and functions, and handles
init() and destroy() specially. As it stands with pyuic from PyQt
3.8, only slots seem to be supported. Although it says, it extracts
an init() function correctly, it is missing in the resulting py file:
unpack the tar ball, "cd test-0.1; make; python test.py" should make
this obvious.
An init() slot is handled correctly, but unfortunately it is called at
the end of __init__() (which is expected).
Proposal: make functions work in pyuic(3) and add another special
cased function: __init(), which is called before Parent.__init__().
(see test-ok.py for a working example)
Comments are highly appreciated.
Does anybody has an idea, how to solve this currently without hacking
pyuic or the resulting python module?
Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-0.1.tar.gz
Type: application/x-tgz
Size: 5919 bytes
Desc: not available
Url : http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20031015/fed6021c/test-0.1.tar.bin
More information about the PyQt
mailing list