I just finished writing a simple program with multiple top level windows, using Qt. In my script, windows open other windows by calling functions stored in the other windows file. For example, if I were on Window 1 and I clicked on a menu item that was supposed to bring up Window 2, my click would signal a slot that calls the run() function from Window 2, and Window 2 would run, and the two windows would live happily ever after.
There's no way that's best practice. I feel like I should have one 'driver' script, which would have specific functions that could be called every time a new window needs opened. Is that feasible? Is that a better idea? What's best practice in this case?