[PyKDE] Creating constructor code for python+designer3 project
Gilbert Ramirez
gram at alumni.rice.edu
Mon Oct 3 18:05:13 BST 2005
I leave the pyuic-generated code alone, and write my own main form
class which inherits from *that*. For example, my MainWindow.py file,
which has *my* code, starts like this:
from main_window import main_window_form
class MainWindow(main_window_form):
def __init__(self):
main_window_form.__init__(self,None,None,0)
# my own code here.....
--gilbert
On 10/3/05, gash at hush.ai <gash at hush.ai> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hello everyone,
> I am fairly new to writing software for the python interpreter and
> hence I have run into some issues. Maybe someone can give me some
> good advice.
>
> What I wish to do is to keep all of the code relating to the main
> application form, in the same project as the actual UI, meaning;
> inside QT-designer. Designer tells me to create functions called
> init() and destroy(), and within those functions write the code i
> wish to execute at creation and deletion of the main form object.
>
> I have done this but to no avail. A quick guesse is that pyuic dont
> know what to do with my additional functions and because of this,
> just leaves them be. I have also tried to implement my own
> constructor for the main form class. I may have done it wrong, I am
> not sure. All I know is it did not work as I expected it to. When I
> run the code I still can not get my init code to execute. In fact
> there is no trace of the code in the generated code that comes out
> of pyuic.
>
> If anyone knows how to solve this (seemingly simple problem) please
> do let me know on gash (at) hush.ai
>
> Thank you and best regards,
> Peter
> -----BEGIN PGP SIGNATURE-----
> Note: This signature can be verified at https://www.hushtools.com/verify
> Version: Hush 2.4
>
> wkYEARECAAYFAkNA5qsACgkQN7khALeDuw1vdACghicZrhkiGmwoXit8fP1pUeTDMC0A
> nj1Yp2L2YMbFCYUms2zJTd1o6sXj
> =8lO5
> -----END PGP SIGNATURE-----
>
>
>
>
> Concerned about your privacy? Follow this link to get
> secure FREE email: http://www.hushmail.com/?l=2
>
> Free, ultra-private instant messaging with Hush Messenger
> http://www.hushmail.com/services-messenger?l=434
>
> Promote security and make money with the Hushmail Affiliate Program:
> http://www.hushmail.com/about-affiliate?l=427
>
> _______________________________________________
> PyKDE mailing list PyKDE at mats.imk.fraunhofer.de
> http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
>
>
More information about the PyQt
mailing list