# Dock QtWidget to Unreal

**URL:** <https://forums.unrealengine.com/t/dock-qtwidget-to-unreal/132235>\
**Category:** Editor Scripting\
**Tags:** unreal-engine\
**Created:** [October 16, 2019, 1:05am UTC](https://forums.unrealengine.com/t/dock-qtwidget-to-unreal/132235 "2019-10-16T01:05:38Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![schiho](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@schiho](https://forums.unrealengine.com/u/schiho)\
**Post date:** [October 16, 2019, 1:05am UTC](https://forums.unrealengine.com/t/dock-qtwidget-to-unreal/132235/1 "2019-10-16T01:05:38Z")

</div>

Is there a way to dock a Qt Widget to an Editor UI?

---

<div class="post-metadata">

**Author:** ![andrea.b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@andrea.b](https://forums.unrealengine.com/u/andrea.b)\
**Post date:** [October 16, 2019, 7:50am UTC](https://forums.unrealengine.com/t/dock-qtwidget-to-unreal/132235/2 "2019-10-16T07:50:06Z")

</div>

I don’t think you can use Qt framework inside Unreal Engine 4 editor without heavily modifying the engine, and honestly I don’t know why you want to do that. Slate is a really powerful UI framework and also there is now the possibility to create UMG Editor Widget.

---

<div class="post-metadata">

**Author:** ![andreas.ranman](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@andreas.ranman](https://forums.unrealengine.com/u/andreas.ranman)\
**Post date:** [October 16, 2019, 8:36am UTC](https://forums.unrealengine.com/t/dock-qtwidget-to-unreal/132235/3 "2019-10-16T08:36:18Z")

</div>

We use PySide in Unreal so basically Qt. Can’t answer regarding to docking the widgets so would be interesting if someone have experience doing this.

```auto

window = None # Required to be a global variable due to Unreals garbage collector
def main():
    app = None
    if not QApplication.instance():
        app = QApplication(sys.argv)

    global window
    window = MyWidget()

    unreal.parent_external_window_to_slate(window.winId())
    window.show()

if __name__ == " __main__":
    main()

```

---

<div class="post-metadata">

**Author:** ![schiho](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@schiho](https://forums.unrealengine.com/u/schiho)\
**Post date:** [October 16, 2019, 9:50pm UTC](https://forums.unrealengine.com/t/dock-qtwidget-to-unreal/132235/4 "2019-10-16T21:50:00Z")

</div>

Yeah, we are using it in a similar fashion, but without setting the winId

However, didn’t find a good way of docking.

There are many reasons why you would wan’t to use pyqt in unreal. For instance, if you already have a tool that is written in pyqt and wan’t to integrate it into unreal. Furthermore, there is not a lot of information about custom UI’s about Unreal, I wouldn’t know how to replicate a full-blown pyqt interface like treeviews/tabs/modifiers.

---

<div class="post-metadata">

**Author:** ![andrea.b](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@andrea.b](https://forums.unrealengine.com/u/andrea.b)\
**Post date:** [October 17, 2019, 8:13am UTC](https://forums.unrealengine.com/t/dock-qtwidget-to-unreal/132235/5 "2019-10-17T08:13:00Z")

</div>

> [@schiho](#):
>
> @andrea.b  
> There are many reasons why you would wan’t to use pyqt in unreal. For instance, if you already have a tool that is written in pyqt and wan’t to integrate it into unreal. Furthermore, there is not a lot of information about custom UI’s about Unreal, I wouldn’t know how to replicate a full-blown pyqt interface like treeviews/tabs/modifiers.

The Slate UI framework (which is the same framework that powers UE4 Editor) is pretty solid in terms of widgets and features, however is not well documented. I usually dig into the UE4 Editor code to understand how to use its API.

I can tell you that you can dock any kind of custom widget (SCoumpondWidget) using the FGlobalTabmanager singleton instance, create a SDockTab widget and set your custom widget as its content. I don’t know if you can somehow bridge a PyQt widget as content for a SDockTab.  
As for TreeViews there is a widget called STreeView that is used widely in the Editor, the ContentBrowser and WorldOutliner use that.
