[prev in list] [next in list] [prev in thread] [next in thread]
List: pykde
Subject: [PyQt] Subclassed QMainWindow is shown and instantly disappear
From: "=?UTF-8?Q?Filip_Gruszczy=C5=84ski?=" <gruszczy () gmail ! com>
Date: 2008-12-29 18:41:02
Message-ID: 1be78d220812291041k1afba0b4md77096f6eee2fa9 () mail ! gmail ! com
[Download RAW message or body]
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
_______________________________________________
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