python - "Underlying C/C++ object has been deleted" -
i'm having exception running simple application in python 2.7 qt. code:
# *-* coding: utf-8 *-* __author__ = 'luismasuelli' import sys pyqt4 import qtgui class streamwidget(qtgui.qwidget): def __init__(self): super(streamwidget, self).__init__(self) self.initialize() def initialize(self): self.setwindowtitle("stream capture test") self.resize(400, 300) self.center() self.show() def center(self): qr = self.framegeometry() cp = qtgui.qdesktopwidget().availablegeometry().center() qr.movecenter(cp) self.move(qr.topleft()) def main(): app = qtgui.qapplication(sys.argv) window = streamwidget() sys.exit(app.exec_()) main()
sh*t:
runtimeerror: underlying c/c++ object has been deleted (at super() call line)
what error , how can solve it? appreciated.
got error! passed parameter (self) without noticing it. i'm noob @ , seems parameter parent widget. passing self not logically wrong uninitialized qt object.
Comments
Post a Comment