<!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.32.1">
</HEAD>
<BODY>
Il giorno mar, 04/01/2011 alle 11.05 +0100, Detlev Offenbach ha scritto:
<BLOCKQUOTE TYPE=CITE>
<PRE>
On Dienstag, 4. Januar 2011, Lists SVR wrote:
> Hi,
>
> I have a dialog that require some time to load, to speed up the things I
> keep this dialog in memory, so I create it the first time and then I add
> a global reference, something like this:
>
> app_global.mydialog=mydialog
>
> and when this variable is populated I do:
>
> app_global.mydialog.exec_()
>
> this seems to work fine, however in some rare situations (I'm unable to
> reproduce sistematically) when I try to open the dialog I have the
> error:
>
> RuntimeError: underlying C/C++ object has been deleted
>
> now in my use case this is simple to fix, before open the dialog I check
> that the c/C++ object is still there
What is the code to do that?
</PRE>
</BLOCKQUOTE>
<BR>
try: <BR>
app_global.mydialog.ui.textEditInput.toPlainText()<BR>
except:<BR>
create a new dialog and update app_global.mydialog for the next times<BR>
<BR>
<BLOCKQUOTE TYPE=CITE>
<PRE>
> and if not I recreate the whole
> dialog and update the global reference, however I would like to know why
> qt destroy an object even if I keep a reference to it and how to force
> qt to never destroy a QDialog,
>
> thanks
> Nicola
>
> _______________________________________________
> PyQt mailing list <A HREF="mailto:PyQt@riverbankcomputing.com">PyQt@riverbankcomputing.com</A>
> <A HREF="http://www.riverbankcomputing.com/mailman/listinfo/pyqt">http://www.riverbankcomputing.com/mailman/listinfo/pyqt</A>
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>