Re: Sub form issues.
Ashley Winters <[email protected]> Wed, 1 Jun 2005 20:14:50 -0700 (PDT)
| Newsgroups | gmane.comp.kde.devel.perl |
|---|---|
| Message-ID | <[email protected]> |
--- 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