[Kde-perl] Sub form issues.

Roy Souther roy at SiliconTao.com
Thu Jun 2 18:33:25 CEST 2005


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 <roy at SiliconTao.com> 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
> Kde-perl at kde.org
> 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.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kde-perl/attachments/20050602/f20930d4/attachment.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://mail.kde.org/pipermail/kde-perl/attachments/20050602/f20930d4/attachment.pgp


More information about the Kde-perl mailing list