How to close the qt widget ui on a button clicked in promoted widget?

5.9k views Asked by At

I have a qt designer ui form, which has a qwidget at the bottom of the form. 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.

If i use traditional methods of implementing clicked() slot and say this->close();, only the promoted widget will be closed.

I want the entire ui to be closed and then open the Home form. How do I go about it? Is there a call to the qt designer ui form from the promoted widget to indicate that the home pushbutton is clicked?

Any help is appreciated. Thank you

1

There are 1 answers

4
Vahid Nateghi On BEST ANSWER

You need to add a SIGNAL to your class (let's say named close()) and then whenever the button is pressed this SIGNAL goes off and by connecting your class to this signal you can set you form to close. Here you can find a basic tutorial on SIGNALS. If you put your code in the question I could guide you through the code as well.