<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/3.2.2">
</HEAD>
<BODY>
That solution works great, thanks.<BR>
<BR>
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.<BR>
<BR>
Is there a better way? Perl should clean up the garbage when it is done. <BR>
Is there a destructor for Object Perl? Like <BR>
delete(this-&gt;{SubForm});<BR>
<BR>
<BR>
On Wed, 2005-06-01 at 20:14 -0700, Ashley Winters wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">--- Roy Souther &lt;<A HREF="mailto:roy@SiliconTao.com">roy@SiliconTao.com</A>&gt; wrote:</FONT>

<FONT COLOR="#000000">&gt; Corrections to my message. I shortend the code to simplify it and did</FONT>
<FONT COLOR="#000000">&gt; not look at what I was typing.</FONT>

<FONT COLOR="#000000">Howdy Roy.</FONT>

<FONT COLOR="#000000">The problem is that the code &quot;$SubForm1 = SubForm&quot; when at the global</FONT>
<FONT COLOR="#000000">scope in a module (anything like Foo.pm) is being run at *compile*</FONT>
<FONT COLOR="#000000">time, before the Qt::Application is constructed. That's going to fail.</FONT>

<FONT COLOR="#000000">If you want to store the variable inside your 'this' object as a</FONT>
<FONT COLOR="#000000">private variable, you could use this-&gt;{SubForm}</FONT>

<FONT COLOR="#000000">sub NEW {</FONT>
<FONT COLOR="#000000">    ...</FONT>
<FONT COLOR="#000000">    this-&gt;{SubForm} = SubForm;</FONT>
<FONT COLOR="#000000">    ...</FONT>
<FONT COLOR="#000000">}</FONT>

<FONT COLOR="#000000">sub OnWhatever {</FONT>
<FONT COLOR="#000000">    ...</FONT>
<FONT COLOR="#000000">    this-&gt;{Subform}-&gt;show;</FONT>
<FONT COLOR="#000000">    ...</FONT>
<FONT COLOR="#000000">}</FONT>

<FONT COLOR="#000000">My concern there would be that you're not passing a parent object to</FONT>
<FONT COLOR="#000000">SubForm. Normally, you construct subwindows using Widget(this) so that</FONT>
<FONT COLOR="#000000">when the 'this' window is closed, all its child windows (including that</FONT>
<FONT COLOR="#000000">Widget) get closed as well.</FONT>

<FONT COLOR="#000000">Qt tries to take care of closing windows for you, but if you have</FONT>
<FONT COLOR="#000000">reasons to do otherwise, just make sure it's taken care of.</FONT>

<FONT COLOR="#000000">Good luck!</FONT>

<FONT COLOR="#000000">Ashley Winters</FONT>



<FONT COLOR="#000000">                </FONT>
<FONT COLOR="#000000">__________________________________ </FONT>
<FONT COLOR="#000000">Discover Yahoo! </FONT>
<FONT COLOR="#000000">Find restaurants, movies, travel and more fun for the weekend. Check it out! </FONT>
<FONT COLOR="#000000"><A HREF="http://discover.yahoo.com/weekend.html">http://discover.yahoo.com/weekend.html</A> </FONT>

<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">Kde-perl mailing list</FONT>
<FONT COLOR="#000000"><A HREF="mailto:Kde-perl@kde.org">Kde-perl@kde.org</A></FONT>
<FONT COLOR="#000000"><A HREF="https://mail.kde.org/mailman/listinfo/kde-perl">https://mail.kde.org/mailman/listinfo/kde-perl</A></FONT>

</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<U><A HREF="mailto:roy@SiliconTao.com">Roy Souther</A></U><BR>
<U><A HREF="http://www.SiliconTao.com">www.SiliconTao.com</A></U><BR>
Let Open Source help your business move beyond.<BR>
<BR>
For security this message is digitally authenticated by <U><A HREF="http://www.gnupg.org">GnuPG</A></U>.
</TD>
</TR>
</TABLE>
<BR>
<BR>
<BR>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>