[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: [PyKDE] bug in pyqt4/python in QTextEdit/QTextBlockUserData
From:       Phil Thompson <phil () riverbankcomputing ! co ! uk>
Date:       2006-11-11 9:59:41
Message-ID: 200611110959.42343.phil () riverbankcomputing ! co ! uk
[Download RAW message or body]

On Thursday 09 November 2006 8:36 am, Pavol Mravec wrote:
> The following example will cause python to segfault in linux and
> window. tested on latest debian sid pyqt packages and latest windows
> binary distribution of pyqt on winxp. Just run it and when you close
> the window, python itself segfaults.
>
> I would expect at least some sort of exception raised but i think the
> program below is correct and should work normal without any
> segfaulting or raising exceptions.
>
> from PyQt4.QtGui import *
>
> class UserData(QTextBlockUserData):
>     def __init__(self):
>         QTextBlockUserData.__init__(self)
>
> class MainWindow(QMainWindow):
>     def __init__(self, *args):
>         QMainWindow.__init__(self, *args)
>
>         self.te=QTextEdit()
>         self.setCentralWidget(self.te)
>         self.ud=UserData()
>         self.te.textCursor().block().setUserData(self.ud)
>
> app=QApplication(sys.argv)
> mw=MainWindow()
> mw.show()
> app.exec_()

It's an object ownership bug and will be fixed in tonight's snapshot.

Phil

_______________________________________________
PyKDE mailing list    PyKDE@mats.imk.fraunhofer.de
http://mats.imk.fraunhofer.de/mailman/listinfo/pykde
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic