[PyQt] Segmentation fault. What could be the cause?
Hi all, in one of my SIP files I have this line (a class constructor): MessageDialog(QMessageBox::Icon icon /TransferThis/, const QString title /TransferThis/, const QString text /TransferThis/, QMessageBox::StandardButtons buttons /TransferThis/ = QMessageBox::NoButton, QWidget * parent /TransferThis/ = 0); When refering to this constructor later in my Python code, the following lines will cause a segmentation fault app = QApplication(argv) about = ui.MessageDialog(QMessageBox.Icon(QMessageBox.Information), app.tr(argv[1]), app.tr(argv[2]), QMessageBox.No | QMessageBox.Yes) Can this be caused by the TransferThis annotation? Or by the C++ reference to the QString? Or do you see something else, that's wrong with this? ## If you want to have a closer look at the project, see here: https://github.com/tuxor1337/PyOnyx The problematic line is in ui/message_dialog.sip. ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Segmentation fault. What could be the cause?
On Tue, 01 May 2012 12:04:19 +0200, tuxor1...@web.de wrote: Hi all, in one of my SIP files I have this line (a class constructor): MessageDialog(QMessageBox::Icon icon /TransferThis/, const QString title /TransferThis/, const QString text /TransferThis/, QMessageBox::StandardButtons buttons /TransferThis/ = QMessageBox::NoButton, QWidget * parent /TransferThis/ = 0); When refering to this constructor later in my Python code, the following lines will cause a segmentation fault app = QApplication(argv) about = ui.MessageDialog(QMessageBox.Icon(QMessageBox.Information), app.tr(argv[1]), app.tr(argv[2]), QMessageBox.No | QMessageBox.Yes) Can this be caused by the TransferThis annotation? Or by the C++ reference to the QString? Or do you see something else, that's wrong with this? ## If you want to have a closer look at the project, see here: https://github.com/tuxor1337/PyOnyx The problematic line is in ui/message_dialog.sip. You definitely need to remove all the /TransferThis/ except for the one on the parent argument. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt
Re: [PyQt] Segmentation fault. What could be the cause?
Thanks, that worked :) Now everything is running fine. You definitely need to remove all the /TransferThis/ except for the one on the parent argument. Phil ___ PyQt mailing listPyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt