So basically you will have a dialog to query some data from your user. Then the usual way is to show the dialog in a blocking manner and then grab the data from it. Check QDialog and QInputDialog.
You should also write down how your application shall work.
Sharing data between widgets does not mean using global state variable but designing data sharing properly.