Segfault when setting QDialogButtonBox buttons from focus-lost signal

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Segfault when setting QDialogButtonBox buttons from focus-lost signal

Valentin Valls
Hi,

I fall down into a segfault caused by the use of QDialogButtonBox.

Clicking on a button from the box that is at the same time removed by a
focus signal created a segfault.

I used PyQt 5.11.3 and Python 3.5.

That's maybe a Qt issue, and maybe nothing can be done in PyQt. But i
case it can help, here is the sample to reproduce the issue.

- Set the focus to the line edit
- Click on the Abort button

Regards,

===========================

from PyQt5 import Qt

app = Qt.QApplication([])

dialog = Qt.QDialog()
layout = Qt.QVBoxLayout(dialog)
line = Qt.QLineEdit(dialog)
box = Qt.QDialogButtonBox(dialog)
box.setStandardButtons(Qt.QDialogButtonBox.Abort)
layout.addWidget(line)
layout.addWidget(box)

def update_box():
    box.setStandardButtons(Qt.QDialogButtonBox.Ok)

line.editingFinished.connect(update_box)

dialog.exec_()


_______________________________________________
PyQt mailing list    [hidden email]
https://www.riverbankcomputing.com/mailman/listinfo/pyqt

valentin_valls.vcf (308 bytes) Download Attachment