[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    [PyQt] Re: Subclassed QMainWindow is shown and instantly disappear
From:       "=?UTF-8?Q?Filip_Gruszczy=C5=84ski?=" <gruszczy () gmail ! com>
Date:       2008-12-29 19:05:48
Message-ID: 1be78d220812291105s503bfda0lcea83588f86dbc8a () mail ! gmail ! com
[Download RAW message or body]

OK, I finally found out, that it's GC that's deleting the editor.
Still, I have no idea which reference causes it not to delete my other
editors. I'll just keep explicit references and it all should be ok.

2008/12/29 Filip Gruszczyński <gruszczy@gmail.com>:
> I am subclassing QMainWindow to create editors invoked from my browser
> application. This goes like this:
>
> action = QAction('Edit', self)
> self.connect(action, SIGNAL('triggered()'), resource.invokeEditor)
> menu.addAction(action)
>
> for most resources everything is ok and the editor is invoked. But for one:
>
> def invokeEditor(self):
>        DocumentEditor(self).show()
>
> the editor is first shown and then hidden again. I was using editor
> from PyQt examples (a bit changed). But when I tried it for even a
> simple one like this:
>
> class DocumentEditor(QMainWindow):
>
>        def __init__(self, resource):
>                QMainWindow.__init__(self)
>                print "Initializing Document editor"
>                self.__edit = QTextEdit()
>                self.setCentralWidget(self.__edit)
>
> I can see, that the editor is invoked, but instantly disappears. I
> just can't understand what I am doing suddenly wrong, because for all
> other editors (big editor built dynamically from an xml description
> and graphical editor for plans) work just fine and never disappear.
> What have I forgotten? Do I have to add some parent information?
>
> --
> Filip Gruszczyński
>



-- 
Filip Gruszczyński

_______________________________________________
PyQt mailing list    PyQt@riverbankcomputing.com
http://www.riverbankcomputing.com/mailman/listinfo/pyqt
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic