Yes, I had exactly same error. RuntimeError "underliying C/C++ object has been deleted"
And I think after explanation from David, I will try stackedwidget. Thanks both of you, Mrugesh. 2010/1/21 David Boddie <da...@boddie.org.uk> > On Wed, 20 Jan 2010 10:46:10 -0800, Jamie Riotto wrote: > > > When I run this, it correctly sets Text Edit #1 as Central Widget. > > Pressing "Editor-2" button correctly changes the Central > > Widget to Text Edit #2, however, when I press "Editor-1" button to > > restore Text Edit #1 to Central Widget I get: > > > > RuntimeError > > "underliying C/C++ object has been deleted" > > > > Any clues as to what I'm doing wrong??? Thanks - jamie > > Qt deletes the existing central widget behind the scenes when you set a > new one: > > http://qt.nokia.com/doc/4.6/qmainwindow.html#setCentralWidget > > If you want to use multiple reusable widgets, put them in a QStackedWidget > and set that as the central widget. > > David > _______________________________________________ > PyQt mailing list PyQt@riverbankcomputing.com > http://www.riverbankcomputing.com/mailman/listinfo/pyqt >
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt