Have a look at Qt designer. Choose Settings->Preferences->User Interface Mode->Multiple Top Level Windows.

I'm not sure how they have implemented this, but you can have a look in the sources yourself.