You must use QDialog instead QMainWindow