[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: Re: [PyKDE] Troubles using a function to load pixmap in designer forms
From: Phil Thompson <phil () river-bank ! demon ! co ! uk>
Date: 2003-04-16 10:30:52
[Download RAW message or body]
On Wednesday 16 April 2003 11:13 am, Aurélien Gâteau wrote:
> Hi list!
>
> When you create a form with Designer, it's possible to use a function to
> load pixmaps in widgets. I wrote a PixmapLoader module which contains a
> "load()" function. This function takes a string as a parameter and returns
> a QPixmap, so it's a good candidate for a pixmap loading function.
>
> My first trouble was that Designer does not allow dots in function names so
> I used the name "pixmapLoad". All that was needed was to add a line like
> this at the top of the file :
>
> from PixmapLoader import load as pixmapLoad
>
>
> Second trouble is to add this line automatically: I can't find any way in
> Designer to specify some code to be added at the beginning of the generated
> file. My idea is to add a new parameter to pyuic. This parameter would be a
> file containing extra code to be added before the class definition. Looking
> at pyuic code it seems easy to do, but I would like to have your opinion on
> any simpler way to achieve what I want before starting to hack.
This functionality is already in the current snapshots. It's even documented
(see the section "Using Qt Designer").
Phil
_______________________________________________
PyKDE mailing list PyKDE@mats.gmd.de
http://mats.gmd.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic