<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">hello<div class=""><br class=""></div><div class="">I’m new into pyqt5 and going through the basics. I recieve an „unexpected quit“ alert in the following situations:</div><div class=""><ul class="MailOutline"><li class="">a <i class="">mousePressEvent</i> with an <i class="">pyqtSignal</i> object <i class="">.emit()</i> either <i class="">self.close</i> or<i class=""> QApplication.instance().quit</i> resulting in the os x alert. First it seems to properly proceed and quit, but after a moment the alert pops up. Same output via Qwidget or QMainWindow root object. Terminal output> Abort trap: 6</li><li class="">opening <i class="">QColorDialog.getColor() </i>and returning the color to a QFrame. Running time this works, multiple times. But when closing the application (red button or cmd-Q) results in the os x alert. While terminal> Segmentation fault: 11.</li></ul><div class=""> Here the code of the QColorDialog, so you see how I build the app:</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><div class="">import sys</div><div class="">from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QFrame, QColorDialog</div><div class="">from PyQt5.QtGui import QColor</div><div class=""><br class=""></div><div class="">class Example(QWidget):</div><div class=""><br class=""></div><div class=""> def __init__(self):</div><div class=""> super().__init__()</div><div class=""><br class=""></div><div class=""> self.initUI()</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> def initUI(self):</div><div class=""><br class=""></div><div class=""> col = QColor(0, 0, 0)</div><div class=""><br class=""></div><div class=""> self.btn = QPushButton('Dialog', self)</div><div class=""> self.btn.move(20, 20)</div><div class=""> self.btn.clicked.connect(self.showDialog)</div><div class=""><br class=""></div><div class=""> self.frm = QFrame(self)</div><div class=""> self.frm.setStyleSheet("QWidget {{ background-color: {} }}".format(col.name()))</div><div class=""> self.frm.setGeometry(130, 22, 100, 100)</div><div class=""><br class=""></div><div class=""> self.setGeometry(300, 300, 250, 180)</div><div class=""> self.setWindowTitle('From here to color dialog')</div><div class=""><br class=""></div><div class=""> self.show()</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""> def showDialog(self):</div><div class=""><br class=""></div><div class=""> col = QColorDialog.getColor()</div><div class=""><br class=""></div><div class=""> if col.isValid():</div><div class=""> self.frm.setStyleSheet("QWidget {{ background-color: {} }}".format(col.name()))</div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">if __name__ == '__main__':</div><div class=""><br class=""></div><div class=""> app = QApplication(sys.argv)</div><div class=""> ex = Example()</div><div class=""> sys.exit(app.exec_())</div></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class="">Any suggestions? Need to dig into the os-x alert error-report?</div><div class=""><br class=""></div><div class="">Many many thanks in advance! I really started to like pyqt, after using tkinter for a while :)</div><div class=""><br class=""></div><div class=""><br class=""></div></body></html>