If don't made MainWindow a member variable of a QDialog, how to can executable event in QDialog. So what is your idea?