Technically, any widget initialized with NULL is a top-level widget, so QApplication should not assume that one of them is better than the other.
I usually do this to save a pointer to the "real" main widget somewhere, even a global variable or singleton, and refer to it when necessary.
source
share