I have a program that opens another window and i want the old window to close. Is there some function or something that would close the window through the code but keep the other window running?
Detailed Description. Close events are sent to widgets that the user wants to close, usually by choosing "Close" from the window menu, or by clicking the X title bar button. They are also sent when you call QWidget::close() to close a widget programmatically.
The qwidget has a promoted widget. The promoted widget has a number of labels and buttons. One of the buttons is a home button. On clicking this button the user needs to close the form and open the home form.
To turn off the Maximize Button on the default windows, set the max size of your Window on your Ui file. You will notice the Maximize button is greyed out when you run your program.
this->close();
or
close();
Ref: http://doc.qt.digia.com/4.7/qwidget.html#close
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With