Usually, you give getters and setters to your dialog and set it up before showing it from the MainWindow, then once done, you grab the data you want from it and modify your MainWindow using the getters.