How to get the main window of the editor, to parent Qt or PySide application to it?

I’m interested in this too, but I would prefer a Native Gui solution in unreal-python.

What I do at the moment:

def tool_function_called_in_a_button():
    app     = QtWidgets.QApplication.instance() or QtWidgets.QApplication( sys.argv )  # unreal crashes without this
    
    global window   # window disappears without this
    window  = QtWidgets.QWidget()  # crash without app line
    window.show()
    unreal.parent_external_window_to_slate( window.winId() )    # attach to unreal, keep it on top of main window.
1 Like