git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Marco Costalba" <mcostalba@gmail.com>
To: "Jan Hudec" <bulb@ucw.cz>
Cc: "Fredrik Kuivinen" <frekui@gmail.com>,
	"Paul Mackerras" <paulus@samba.org>,
	"Alex Riesen" <raa.lkml@gmail.com>,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Karl Hasselstr?m" <kha@treskal.com>,
	"Junio C Hamano" <junkio@cox.net>,
	"Carl Worth" <cworth@cworth.org>,
	"Michael Niedermayer" <michaelni@gmx.at>,
	"Git Mailing List" <git@vger.kernel.org>
Subject: Re: FFmpeg considering GIT
Date: Thu, 10 May 2007 13:20:02 +0200	[thread overview]
Message-ID: <e5bfff550705100420x63b365f7x526c1d58d9d5c761@mail.gmail.com> (raw)
In-Reply-To: <20070509213610.GA9144@efreet.light.src>

On 5/9/07, Jan Hudec <bulb@ucw.cz> wrote:
> On Wed, May 09, 2007 at 23:09:25 +0200, Fredrik Kuivinen wrote:
> > I have used PyQt for some smaller projects (notably Hgct, a no longer
> > developed
> > commit tool for git and Mercurial. See
> > http://repo.or.cz/w/hgct.git?a=tree). For me
> > PyQt has worked very well. The python interface to Qt is more or less a
> > direct
> > translation of the C++ interface, so the excellent documentation troll
> > tech provides
> > for Qt can be used when developing with PyQt as well.
> >
> > I have never seen the segfaulting you mention. Maybe my programs have been
> > too
> > small to trigger that bug...
>
> It's not about size of the programs. It's about having to be careful not to
> refer to widgets inside eg. dialog box from outside and close that dialog
> box.

In Qt all the classes that ineriths from QObject are memory managed,
to be more clear
you can say that one class is "child" of another class (always
ineritherd from QObject) that becames the parent.

When you delete the parent, all his children are deleted too, this is
a (big) feature to avoid
missing free() calls for resources created with mallocs() , (well, in
C++ we say 'delete' for resources created by 'new' but the concept is
more or less the same).

Note that this property can be nested: create a main window, inside a
window there is a tab form, inside the tab there is a list view,
inside the list view there are items (lines of list view).

So *when* you delete the main window all this stuff is automatically
deleted by Qt. It is diffrent from a garbage collector because there
is no delay in releasing memory and all the thing is strict
deterministic.

So coming to your problem, if you need to refer to a widget inside a
dialog *after* the dialog has been deleted you can simply reparent to
NULL the widget before closing the dialog so to remove your object
from the delete list of the dialog.

Another option, in case your obect is not a graphical widget, is to
avoid declaring your object "child" of the dialog in first instance
setting his parent to NULL. This is clearly better because documents
'in code' also the real relationship between the dialog and your
object.

  Marco

  reply	other threads:[~2007-05-10 11:20 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-02  9:29 FFmpeg considering GIT Panagiotis Issaris
2007-05-02 23:48 ` Jakub Narebski
2007-05-03  1:03   ` Petr Baudis
2007-05-04  0:42     ` Jakub Narebski
2007-05-04  7:21       ` [RFC?] Telling git about more complex relationships between commits (Was: Re: FFmpeg considering GIT) Johan Herland
2007-05-04  9:36         ` Alex Riesen
2007-05-04 11:39           ` Andy Parkins
2007-05-04 12:06             ` Andrew Ruder
2007-05-04 12:30             ` Johan Herland
2007-05-04 11:53           ` Johan Herland
2007-05-04 22:11             ` Alex Riesen
2007-05-05 12:49               ` Johan Herland
2007-05-05 18:03                 ` Alex Riesen
2007-05-05 16:13               ` Johan Herland
2007-05-04 11:10         ` Petr Baudis
2007-05-04 12:22           ` Johan Herland
2007-05-03  1:48 ` FFmpeg considering GIT Martin Langhoff
2007-05-03 18:00 ` Uwe Kleine-König
2007-05-03 20:00   ` Petr Baudis
2007-05-03 20:05     ` david
2007-05-03 20:13       ` Petr Baudis
2007-05-04 13:46     ` Michael Niedermayer
2007-05-04 15:53       ` Andy Parkins
2007-05-04 16:09         ` Johannes Sixt
2007-05-04 17:23           ` Florian Weimer
2007-05-04 16:40       ` Nicolas Pitre
2007-05-04 18:17       ` Carl Worth
2007-05-04 18:25         ` Johan Herland
2007-05-04 20:24         ` Michael Niedermayer
2007-05-05  4:15           ` Linus Torvalds
2007-05-05 13:35         ` Karl Hasselström
2007-05-05 17:26           ` Linus Torvalds
2007-05-05 22:18             ` Linus Torvalds
2007-05-05 22:30               ` Linus Torvalds
2007-05-06  7:49                 ` Junio C Hamano
2007-05-07 12:13                 ` Paul Mackerras
2007-05-07 12:30                   ` Karl Hasselström
2007-05-07 12:50                   ` Johan Herland
2007-05-07 12:56                   ` Alex Riesen
2007-05-08  6:30                     ` Marco Costalba
2007-05-09  4:28                       ` Paul Mackerras
2007-05-09  6:38                         ` Marco Costalba
2007-05-09 18:17                           ` Robin Rosenberg
2007-05-09 18:28                           ` Jan Hudec
2007-05-09 21:09                             ` Fredrik Kuivinen
2007-05-09 21:36                               ` Jan Hudec
2007-05-10 11:20                                 ` Marco Costalba [this message]
2007-05-10 16:52                                   ` Jan Hudec
2007-05-07 17:52                   ` Jan Hudec
2007-05-07 22:10                     ` Gábor Farkas
2007-05-07 23:21                       ` Randal L. Schwartz
     [not found]                       ` <fcaeb9bf0705080707x7ad28afelf98ecd93276042d1@mail.gmail.com>
2007-05-08 15:53                         ` Gábor Farkas
2007-05-07 19:10                   ` Junio C Hamano
2007-05-08  2:03                   ` Shawn O. Pearce
2007-05-08  7:26                   ` Jeff King
2007-05-06  7:56             ` Karl Hasselström
2007-05-06 10:19             ` Karl Hasselström
2007-05-06 16:38               ` Linus Torvalds
2007-05-06  8:15           ` Marco Costalba
2007-05-06 11:14             ` Karl Hasselström
2007-05-06 12:19               ` Marco Costalba
2007-05-06 12:33                 ` Karl Hasselström
2007-05-06 12:33                 ` Marco Costalba
2007-05-06 12:59                   ` Karl Hasselström
2007-05-06 13:03                     ` Karl Hasselström
2007-05-09 22:30                     ` Pavel Roskin
  -- strict thread matches above, loose matches on Subject: below --
2007-05-08  3:39 Brett Schwarz
2007-05-08  4:06 ` Paul Mackerras
2007-05-08  4:19   ` Shawn O. Pearce

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e5bfff550705100420x63b365f7x526c1d58d9d5c761@mail.gmail.com \
    --to=mcostalba@gmail.com \
    --cc=bulb@ucw.cz \
    --cc=cworth@cworth.org \
    --cc=frekui@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=kha@treskal.com \
    --cc=michaelni@gmx.at \
    --cc=paulus@samba.org \
    --cc=raa.lkml@gmail.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).