PDA

View Full Version : How to come out of the execution when cancel button is clicked??



Gokulnathvc
27th April 2011, 07:55
I am having a function in which it executes another dialog with its class name. In that dialog there is a cancel button. I need to do is, when the cancel button is clicked it should come out of the entire thing. How to do this??

FelixB
27th April 2011, 08:07
connect the "clicked()"-signal of the button with the "close()"-slot of your dialog

Gokulnathvc
27th April 2011, 08:13
I am executing the dialog from other dialog class using its object. How to connect with the clicked() signal??

FelixB
27th April 2011, 08:20
sorry, were going back to your old problem. please, describe more precisely, what you want.

you have dialog A and dialog B. which dialog has the close()-button? which dialog do you want to close when the button is clicked?

ChrisW67
29th April 2011, 09:42
If you want a button/tool button/menu to attempt to quit the entire program connect its clicked() or triggered() signal to the QApplication::quit() slot. It doesn't matter if the button is on a dialog (or which dialog), a tool bar or menu.

To anticipate your next question: you access the application object through the global qApp pointer.