By the QT designer, I made this QMainWindow, who has a button, and when click the button, a child dialog will pop up.

At first when the MainWindow and the dialogue were produced at arround the same time, I had the dialogue in the center of the mainwindow. When I click on "X" to close the child dialogue , the dialogue shuts down but the mainwindow stays opened.

After a while, I found that the child dialogue size is too small, so I manually enlarged the size of the dialogue to more than even the mainwindow. Now this time whenever I close the child dialogue, the mainwindow will be closed after the childe is closed.

Now I resize the child dialogue back to the original header class. Biut the same problem stil l happens.


Anyone has any idea what how to solve this problem?


Thanks thanks a lot.