Strange, a normal widget should not even show up as a window if it has a parent, it should become part of the parent.
Your setWindowFlags call probably allows that even when given a parent.

That "close if not referenced" thing is an artifact introduced by Python. Since it is a garbage collector oriented language, all unreference objects get deleted at some point.

I am not sure what you mean with "no menu bar", you are deriving from QWidget, menu bar's is a feature of QMainWindow

Cheers,
_