[PyKDE] Embedding icon inside code

Troy Melhase troy at gci.net
Mon Nov 10 09:49:00 GMT 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Sunday 09 November 2003 23:25, Derek Fountain wrote:
> > Qt Designer + pyuic can also generate a python sequence for use with
> > QPixmap.
>
> Can you give me a clue how? I'm happy to go with Roland's suggestion, but
> if there's a better way...

i can't say if it's better or worse for you, but what works is this:

1.	fire up Qt Designer and create a new dialog or widget
2.	assign the 'icon' property to an image in the filesystem
3.	save the ui file
4.	run pyuic against the saved file
5.	copy and paste the image data from the file

reuse thru copy+paste is lame, but since you're after a single file-solution, 
i'd be tempted to make an exception... but then i'd think better of it and 
use a script to build the single file from the output of convert or pyuic.

even better, you could re-examine the need for a single file solution.  what 
are you going to do when your app grows so complicated that you can't 
reasonably fit it in a single file?  what harm does two or three files cause?  
i ask only rhetorically, of course.

- -- 
Troy Melhase, troy at gci.net
- --
I have sworn upon the altar of God eternal hostility against every form of 
tyranny over the mind of man. - Thomas Jefferson

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/r0/aPPgja6MkvqMRArlEAKDYfVIgjMxAtykt6C63K9e91DDaigCfWIwO
ZCXDTt+QRFA2celBrLmj5eM=
=4F1G
-----END PGP SIGNATURE-----




More information about the PyQt mailing list