Re: Sub form issues.

Roy Souther <[email protected]> Thu, 02 Jun 2005 10:33:25 -0600
Newsgroups gmane.comp.kde.devel.perl
Organization Silicon Tao Technology Systems Inc.
Message-ID <1117730005.18032.4.camel@UtopiaPlanetia>
That solution works great, thanks.

The reason I don't create the sub form with the connection to the
parrent is because in Qt C++ doing so causes the sub form to be embedded
in the parent form rather then a new popup form like a dialog.

Is there a better way? Perl should clean up the garbage when it is
done. 
Is there a destructor for Object Perl? Like 
delete(this->{SubForm});


On Wed, 2005-06-01 at 20:14 -0700, Ashley Winters wrote:

> --- Roy Souther <[email protected]> wrote:
> 
> > Corrections to my message. I shortend the code to simplify it and did
> > not look at what I was typing.
> 
> Howdy Roy.
> 
> The problem is that the code "$SubForm1 = SubForm" when at the global
> scope in a module (anything like Foo.pm) is being run at *compile*
> time, before the Qt::Application is constructed. That's going to fail.
> 
> If you want to store the variable inside your 'this' object as a
> private variable, you could use this->{SubForm}
> 
> sub NEW {
>     ...
>     this->{SubForm} = SubForm;
>     ...
> }
> 
> sub OnWhatever {
>     ...
>     this->{Subform}->show;
>     ...
> }
> 
> My concern there would be that you're not passing a parent object to
> SubForm. Normally, you construct subwindows using Widget(this) so that
> when the 'this' window is closed, all its child windows (including that
> Widget) get closed as well.
> 
> Qt tries to take care of closing windows for you, but if you have
> reasons to do otherwise, just make sure it's taken care of.
> 
> Good luck!
> 
> Ashley Winters
> 
> 
> 
> 		
> __________________________________ 
> Discover Yahoo! 
> Find restaurants, movies, travel and more fun for the weekend. Check it out! 
> http://discover.yahoo.com/weekend.html 
> 
> _______________________________________________
> Kde-perl mailing list
> [email protected]
> https://mail.kde.org/mailman/listinfo/kde-perl
> 


Roy Souther
www.SiliconTao.com
Let Open Source help your business move beyond.

For security this message is digitally authenticated by GnuPG.

_______________________________________________
Kde-perl mailing list
[email protected]
https://mail.kde.org/mailman/listinfo/kde-perl
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQBCnzTUY62fql08qicRAsueAJ9qHkaSlYlWJHCs2icakGLMEyKBiQCfbDmI
tKBLOSR7b9hLDTSnfG20PxY=
=luho
-----END PGP SIGNATURE-----