[PyKDE] Error: QPainter::killPStack: non-empty save/restore stack when end() was called
Phil Thompson
phil at riverbankcomputing.co.uk
Sat Apr 24 18:33:01 BST 2004
On Tuesday 20 April 2004 1:00 pm, Fabio Zadrozny wrote:
> I'm having crashes using PyQt when creating a QApplication, using a
> QCheckListItem.RadioButtonController and then doing it again (I do it in
> unit-test, so that the QApplication is always 'clean'... ) - If I don't't
> use a QCheckListItem.RadioButtonController it doesn't crash...
>
> The code below shows the error (I'm using winXP, python 2.3, qt 3.2.3, pyqt
> 3.10)
>
> from qt import *
>
>
> class MainWindow(QWidget):
>
> def __init__(self):
> QWidget.__init__(self, None)
> self.layout = QVBoxLayout(self)
> self.treeview = QListView(self)
>
> self.treeview.addColumn('')
> self.treeview.header().hide()
> self.layout.addWidget(self.treeview)
>
> self.item = QCheckListItem(self.treeview, None, 'controller',
> QCheckListItem.RadioButtonController)
>
> class TestController(object):
>
> def test(self):
> self.main = MainWindow()
> self.main.show()
> self.main.close()
>
>
> if __name__ == '__main__':
>
> _app = QApplication([])
> t = TestController()
> t.test()
> _app.quit()
> _app = None # necessary, otherwise QApplication doesn't die
>
>
> _app = QApplication([])
> t = TestController()
>
> print 'will crash.....'
> t.test()
> print 'never gets here...'
>
> _app.quit()
> _app = None
>
>
> Output:
> will crash.....
> QPainter::killPStack: non-empty save/restore stack when end() was called
I can't reproduce this on Windows2000 using current snapshots.
Phil
More information about the PyQt
mailing list