Qt-interest Archive, April 2008
WA_DeleteOnClose question
Message 1 in thread
I have set the attribute (*Qt::WA_DeleteOnClose*) on an instance of a
QWidget Class and call the *close()* function
somewhere in the code in order to close the widget and also to delete it.I
had no problem until today when a *
Heap Corruption Detected* and it seems that it is related with this
attribute, cause when I unset the attribute (Qt::WA_DeleteOnClose)
no error is reported.
Is it normal for a widget to change it's behavior and try to delete two
times? Is there something I am missing in the whole
deletion process?
--
[ signature omitted ]
Message 2 in thread
On Monday 14 April 2008 18:21:00 Nikos Geronitidis wrote:
> I have set the attribute (*Qt::WA_DeleteOnClose*) on an instance of a
> QWidget Class and call the *close()* function
> somewhere in the code in order to close the widget and also to delete it.I
> had no problem until today when a *
> Heap Corruption Detected* and it seems that it is related with this
> attribute, cause when I unset the attribute (Qt::WA_DeleteOnClose)
> no error is reported.
> Is it normal for a widget to change it's behavior and try to delete two
> times? Is there something I am missing in the whole
> deletion process?
are you calling delete or deleteLater? can you make a testcase?
--
[ signature omitted ]
Message 3 in thread
Im not a KDE guy... or for that matter have ever coded with KDE, since I use QT for Windows and Mac...
However, when I started coding with QT 5 years ago, and was looking for examples a lot of it was KDE based...
I was looking for a tree widget, and since Qt called it QListWidget, I couldnât find it inside of QT :) I didnât want the multiple columns, or the header...
I was brand new to QT... and was hunting for it.. I found a complete KTreeXXXXX class (I forget the class name) that gave me a OMG... what did I get into feeling... But then I found QListWIdget... I didnât want to build & use KDE for my application...
I think part of it (why there is so much custom KDE), is KDE is close to as old as Qt it self...
I have a feeling, and nothing more than that, that if KDE was started TODAY, much of the custom KDE classes would not be created or used... and base QT classes would be used directly...
For any existing codebase, its VERY hard to re-write the code to new framework classes and throw away now-redundant classes.
Thatâs just my 2 bits as too why... Feel free to ignore me completely :) Just like my wife does when I guess at things
Scott
> -----Original Message-----
> From: Arvid Ephraim Picciani [mailto:aep@xxxxxxxxxxxxxxx]
> Sent: Monday, April 14, 2008 8:51 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: Re: WA_DeleteOnClose question
>
> On Monday 14 April 2008 18:21:00 Nikos Geronitidis wrote:
> > I have set the attribute (*Qt::WA_DeleteOnClose*) on an instance of a
> > QWidget Class and call the *close()* function
> > somewhere in the code in order to close the widget and also to delete
> it.I
> > had no problem until today when a *
> > Heap Corruption Detected* and it seems that it is related with this
> > attribute, cause when I unset the attribute (Qt::WA_DeleteOnClose)
> > no error is reported.
> > Is it normal for a widget to change it's behavior and try to delete
> two
> > times? Is there something I am missing in the whole
> > deletion process?
>
> are you calling delete or deleteLater? can you make a testcase?
>
>
> --
> best regards/Mit freundlichen GrÃÃen
> Arvid Ephraim Picciani
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
Message 4 in thread
Oops ... replied to different thread
> -----Original Message-----
> From: Scott Aron Bloom [mailto:Scott.Bloom@xxxxxxxxxxxx]
> Sent: Monday, April 14, 2008 10:06 AM
> To: qt-interest@xxxxxxxxxxxxx
> Subject: RE: WA_DeleteOnClose question
>
> Im not a KDE guy... or for that matter have ever coded with KDE, since
> I use QT for Windows and Mac...
>
> However, when I started coding with QT 5 years ago, and was looking for
> examples a lot of it was KDE based...
>
> I was looking for a tree widget, and since Qt called it QListWidget, I
> couldnât find it inside of QT :) I didnât want the multiple columns,
> or the header...
>
> I was brand new to QT... and was hunting for it.. I found a complete
> KTreeXXXXX class (I forget the class name) that gave me a OMG... what
> did I get into feeling... But then I found QListWIdget... I didnât
> want to build & use KDE for my application...
>
> I think part of it (why there is so much custom KDE), is KDE is close
> to as old as Qt it self...
>
> I have a feeling, and nothing more than that, that if KDE was started
> TODAY, much of the custom KDE classes would not be created or used...
> and base QT classes would be used directly...
>
> For any existing codebase, its VERY hard to re-write the code to new
> framework classes and throw away now-redundant classes.
>
> Thatâs just my 2 bits as too why... Feel free to ignore me completely
> :) Just like my wife does when I guess at things
>
> Scott
>
> > -----Original Message-----
> > From: Arvid Ephraim Picciani [mailto:aep@xxxxxxxxxxxxxxx]
> > Sent: Monday, April 14, 2008 8:51 AM
> > To: qt-interest@xxxxxxxxxxxxx
> > Subject: Re: WA_DeleteOnClose question
> >
> > On Monday 14 April 2008 18:21:00 Nikos Geronitidis wrote:
> > > I have set the attribute (*Qt::WA_DeleteOnClose*) on an instance of
> a
> > > QWidget Class and call the *close()* function
> > > somewhere in the code in order to close the widget and also to
> delete
> > it.I
> > > had no problem until today when a *
> > > Heap Corruption Detected* and it seems that it is related with this
> > > attribute, cause when I unset the attribute (Qt::WA_DeleteOnClose)
> > > no error is reported.
> > > Is it normal for a widget to change it's behavior and try to delete
> > two
> > > times? Is there something I am missing in the whole
> > > deletion process?
> >
> > are you calling delete or deleteLater? can you make a testcase?
> >
> >
> > --
> > best regards/Mit freundlichen GrÃÃen
> > Arvid Ephraim Picciani
> >
> > --
> > To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx
> with
> > "unsubscribe" in the subject or the body.
> > List archive and information: http://lists.trolltech.com/qt-interest/
>
> Nrzu[ØÚÚ[ré&{zËçyÈ+jwx+Ú[r{
N§²æìr¸zÇu©[hªØµêÞÚÞçÚè[^r(éì®&Þ{azËç-¢»ayºÈ¬µªÜ+Þjwbú+«b¢xm¶ÿ+-²Úè[^r(ú{^ë-
Message 5 in thread
I am not calling *deleteLater()* anywhere myself, I guess if the default
behavior of Qt is to call delete then this is done also in my case. How
could I know if deleteLater() is called?
On Mon, Apr 14, 2008 at 6:51 PM, Arvid Ephraim Picciani <aep@xxxxxxxxxxxxxxx>
wrote:
>
> are you calling delete or deleteLater? can you make a testcase?
>
>
> --
> best regards/Mit freundlichen Grüßen
> Arvid Ephraim Picciani
>
> --
> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with
> "unsubscribe" in the subject or the body.
> List archive and information: http://lists.trolltech.com/qt-interest/
>
>
--
[ signature omitted ]
Message 6 in thread
On Monday 14 April 2008 19:24:15 Nikos Geronitidis wrote:
> I am not calling *deleteLater()* anywhere myself,
and delete neither? well just making sure. can you post a small testcase
reproducing your problem?
--
[ signature omitted ]
Message 7 in thread
Hmm... seems like this is a familiar issues J
You might want to look through last weeks posts... Someone had exactly
this type of issue
But the thing to note... DeleteOnClose does NOT cause an immediate
delete when you call close, so you have to be smart on other access to
that pointer...
Scott
From: Nikos Geronitidis [mailto:geronik444@xxxxxxxxx]
Sent: Monday, April 14, 2008 9:21 AM
To: qt-interest@xxxxxxxxxxxxx
Subject: WA_DeleteOnClose question
I have set the attribute (Qt::WA_DeleteOnClose) on an instance of a
QWidget Class and call the close() function
somewhere in the code in order to close the widget and also to delete
it.I had no problem until today when a
Heap Corruption Detected and it seems that it is related with this
attribute, cause when I unset the attribute (Qt::WA_DeleteOnClose)
no error is reported.
Is it normal for a widget to change it's behavior and try to delete two
times? Is there something I am missing in the whole
deletion process?
--
[ signature omitted ]