I am new to Qt development and have knowledge of c++. I had created some samples in Qt but all are of single form samples.
Now I want to create such app which has more than single form, so I want to know:
1. How to Navigate from One Form to Another.
2. How to pass data from one Form to another Form...
Thanx in advance.
For modal dialogs you can just create a new instance of the dialog on the stack. One way to pass data to this dialog is to use constructor paramters:
MyDialog dlg(param1,param2,param3);
if (dlg.exec())
{
// ... process data from the dlg ...
// call whatever public methods on the dialog while it still exists
// e.g.
myvar = dlg.getReturnValue();
}
For modal dialogs, you can use setResult
to determine whether the user has accepted or rejected the dialog. This is queried in the if statement above.
Modeless dialogs should probably created with wider scope (possibly even global or using creating dynamically)
if (! modelessDlg)
{
modelessDlg = new MyModelessDlg(param1,param2);
}
modelessDlg->show();