[Kde-perl] Sub form issues.

Ashley Winters jahqueel at yahoo.com
Thu Jun 2 05:14:50 CEST 2005


--- 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 



More information about the Kde-perl mailing list