[Solved]How to perform 'reject' of main dialog from inside widget?
-
!http://puu.sh/dLyv6/55f199ccac.png(img)!
There is a widget inside of main dialog
this widget was promoted to a widget class
I want to perform main dialog's 'reject' when press close button of inside widget.
I tried 'exit(0)' but it doesn't perform 'reject'. so I have to add same redundant code to do some work before close.
and 'close()' just close inside widget itself..How to deal with it?
-
Hi and welcome to devnet,
A cleaner solution would be to connect the clicked signal of your close button to the reject slot of your MainDialog
-
[quote author="SGaist" date="1419712665"]Hi and welcome to devnet,
A cleaner solution would be to connect the clicked signal of your close button to the reject slot of your MainDialog[/quote]
In MainDialog's constructor
@connect(ui->InsideWidget,SIGNAL(emitReject()),this,SLOT(reject()));@
Is that right? Thank you! -
Yes, however you should rather call that signal reject also