[PyQt] Segmentation fault. What could be the cause?

tuxor1337 at web.de tuxor1337 at web.de
Tue May 1 11:04:19 BST 2012


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.


More information about the PyQt mailing list