difference between exec() and show(),
Only QDialog have exec() Qwidgets have show.
When you call show on a Dialog, it becomes visible but do not
wait for input.
example
mainw::func() {
MyDialog *dia=new MyDialog(this);
dia->show();
int a=0; // this code is run the moment dialog is shown on screen,
}
using exec()
mainw::func() {
MyDialog dia;
dia.exec();
int a=0; // this code is run only after dialog is dismissed.
}
The version of dialog where u call show() could be called floating so when user click ok
it should emit signal that something should happen. ( to maiwindow )
The exec() version will report back the result ok/cancel/closed at once.
learn when to use QObject, QWidget, QFrame
QWidget is often used if making own widget. QFrame is used if you just need something to draw
a frame. If you use Designer you can check out the Widgets that are available.
QDialog is useful for any type of windows that pop ups up or open via a menu.
I have to set anything inside Register.
Yes, Register should be able to give the data back.
the widgets inside are private so you need a function to return the data.
You might also need to call
http://doc.qt.io/qt-5/qdialog.html#accept
in your Register buttons clicked slot.