Can a QPushButton inside a QDialog create an object and pass it back to a QWidget inside of QMainWindow?

A dialog pops up with data that needs to be used to create a device and then this device gets monitored by the mainwindow.

A rough online example or a chapter to read in a book or a class info would be a great kick starter.