[PyKDE] Error: QPainter::killPStack: non-empty save/restore stack when end() was called

Fabio Zadrozny fabioz at esss.com.br
Tue Apr 20 13:59:01 BST 2004


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




More information about the PyQt mailing list