I am using exec() method to show the dialog and checking the return status.

main window has add_item button which has on click slot as
connect( ui->add_contact, SIGNAL(clicked()), this, SLOT(addItem()) );

The slot functiopn Add_Item is as follows
void MainWindow::addItem()
{
MYDialog dlg( this );
if( dlg.exec() == QDialog::Accepted )//for this we have used signal and slot of OK on dialog_window
{
ui->contact_list->addItem( dlg.name() + " -- " + dlg.number() );
qDebug() << "entry accepted form dialog";
}
}


the MYDialog has a lineedit which on return press event creates a numpad dialog.
//in constructor of MYDialog
connect( ui->num_Edit, SIGNAL( returnPressed () ) , this, SLOT( Accept_numer_thrKeypad() ));


Accept_numer_thrKeypad this function creates/executes numpad.
void Dialog::Accept_numer_thrKeypad( )
{
keypad numpad(this);

QString number;
number = this->number();
numpad.setText(number);

if( numpad.exec() == keypad::Accepted )
{
QString value;
value = numpad.return_valueof_keypad();
setNumber(value);
}
}

Both the childs have accept() and reject() slots connected with the OK and Cancel button created on them.
So when i press OK of numpad i am returning to MainWindow, but i expect i should return to its parent i.e. MYdialog object dlg.