I have a MainWindow and Type class.
A button in the MainWindow sends a signal to a slot with this code:
dialog = new QDialog(this); Ui_type typeui;
The simple way to get input from a modal dialog is QDialog::exec(). This may handle everything you need.
QDialog::exec()