Dialogs question Accept/Cancel

Hi there, when I press either the accept or cancel, the app closed. How could I prevent this?

This is probably because you are simply running the widget. Once the response is returned, the serial process continues until the termination of your script. If you do not have .show() statement or further functionality in your UI, then you would have the ability to do is open, interact with, and close your dialog.

I recommend including the following script in your code to keep the main window open at runtime.

if name == ‘main’:
app = QApplication(sys.argv)
mw = MainWindow()

Of course, you will need to import sys in order to make this whole thing work.