[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyKDE] Troubles using a function to load pixmap in designer forms
From:       Aurélien Gâteau <aurelien () dental-on-line ! fr>
Date:       2003-04-16 10:13:42
[Download RAW message or body]

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.

Regards,
  Aurélien

_______________________________________________
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