# unreal qt
QT PySide2 support for unreal engine 5 (likely works in unreal 4)
- prevent widget from instantly dissapearing due to garbage collection
- automatically style all Qt widgets using Xingyu Lei's [unreal_stylesheet](https://github.com/leixingyu/UnrealStylesheet)
- dark window bar for a better visual match with Unreal
- parent widget to Unreal's main window to stay on top
## Quickstart
this guide assumes you have PySide2 installed already!
1. Add the unreal_qt folder in your python path. See [unreal docs](https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/ScriptingAndAutomation/Python/#pythonpathsintheunrealeditor)
2. Use the following code snippet to create `sample.py` and add it to unreal python path.
```python
# 1. SETUP - this step can automatically run on editor startup when added to your init_unreal.py
import unreal_qt
unreal_qt.setup()
# 2. CREATE WIDGET - create your qt widget
# every widget you make after setup won't block the editor & have unreal styling
from PySide2.QtWidgets import QLabel, QWidget, QVBoxLayout
w = QWidget()
layout = QVBoxLayout()
w.setLayout(layout)
layout.addWidget(QLabel("Hello World!"))
# 3. WRAP WIDGET - (optional) manage garbage collection, add darkbar, stay on top
unreal_qt.wrap(w)
# 4. SHOW WIDGET - if using stay on top this needs to run after the wrap stage
w.show()
```
3. import script in unreal with the Python terminal to run it.
```python
import sample
```
![image](https://user-images.githubusercontent.com/3758308/191580757-f3993797-da80-449e-b9d4-ad311b2f37c5.png)
## Dark title bar
The windows bar is by default white on Windows, and QT can't change the bar color.
With unreal_qt you can add a custom bar.
- default window bar & frame
![image](https://user-images.githubusercontent.com/3758308/191618705-45914a58-893b-4680-995e-976571b7c7eb.png)
- custom bar, no frame (no resize support!)
![image](https://user-images.githubusercontent.com/3758308/191618309-13e7329f-4310-407a-9eef-383a113e1ac1.png)
- custom bar, frame, no title bar (supports resize)
![image](https://user-images.githubusercontent.com/3758308/191618151-319b8530-addb-4b9a-a51f-5da0a90a4fd3.png)
## community
- tech-artists.org [PySide and Unreal5](https://discourse.techart.online/t/pyside-and-unreal5/15475/6) thread
- [ ] TODO unreal forums thread
## similar to
- https://github.com/FXTD-ODYSSEY/Unreal-PyToolkit
Raw data
{
"_id": null,
"home_page": "",
"name": "unreal-qt",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.4",
"maintainer_email": "",
"keywords": "application,unreal,pyside,pyqt,qt,engine,unrealengine",
"author": "Hannes D",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/81/99/fbe1614c550bfc971183d842d72834a8ca5fd70ab39a898aa0730bc63f4b/unreal-qt-0.0.1.tar.gz",
"platform": null,
"description": "# unreal qt\nQT PySide2 support for unreal engine 5 (likely works in unreal 4)\n- prevent widget from instantly dissapearing due to garbage collection\n- automatically style all Qt widgets using Xingyu Lei's [unreal_stylesheet](https://github.com/leixingyu/UnrealStylesheet)\n- dark window bar for a better visual match with Unreal\n- parent widget to Unreal's main window to stay on top\n \n\n## Quickstart\n\nthis guide assumes you have PySide2 installed already!\n1. Add the unreal_qt folder in your python path. See [unreal docs](https://docs.unrealengine.com/4.27/en-US/ProductionPipelines/ScriptingAndAutomation/Python/#pythonpathsintheunrealeditor)\n2. Use the following code snippet to create `sample.py` and add it to unreal python path.\n```python\n# 1. SETUP - this step can automatically run on editor startup when added to your init_unreal.py\nimport unreal_qt\nunreal_qt.setup() \n\n# 2. CREATE WIDGET - create your qt widget\n# every widget you make after setup won't block the editor & have unreal styling\nfrom PySide2.QtWidgets import QLabel, QWidget, QVBoxLayout\nw = QWidget()\nlayout = QVBoxLayout()\nw.setLayout(layout)\nlayout.addWidget(QLabel(\"Hello World!\"))\n\n# 3. WRAP WIDGET - (optional) manage garbage collection, add darkbar, stay on top\nunreal_qt.wrap(w)\n\n# 4. SHOW WIDGET - if using stay on top this needs to run after the wrap stage\nw.show()\n```\n3. import script in unreal with the Python terminal to run it.\n```python\nimport sample\n```\n\n![image](https://user-images.githubusercontent.com/3758308/191580757-f3993797-da80-449e-b9d4-ad311b2f37c5.png)\n\n## Dark title bar\nThe windows bar is by default white on Windows, and QT can't change the bar color.\n\nWith unreal_qt you can add a custom bar.\n\n- default window bar & frame\n\n![image](https://user-images.githubusercontent.com/3758308/191618705-45914a58-893b-4680-995e-976571b7c7eb.png)\n\n- custom bar, no frame (no resize support!)\n\n![image](https://user-images.githubusercontent.com/3758308/191618309-13e7329f-4310-407a-9eef-383a113e1ac1.png)\n\n- custom bar, frame, no title bar (supports resize)\n\n![image](https://user-images.githubusercontent.com/3758308/191618151-319b8530-addb-4b9a-a51f-5da0a90a4fd3.png)\n\n\n## community\n- tech-artists.org [PySide and Unreal5](https://discourse.techart.online/t/pyside-and-unreal5/15475/6) thread \n- [ ] TODO unreal forums thread\n\n## similar to\n- https://github.com/FXTD-ODYSSEY/Unreal-PyToolkit\n",
"bugtrack_url": null,
"license": "",
"summary": "A Qt manager for Unreal that enables the use of PyQt & PySide in Unreal Engine",
"version": "0.0.1",
"project_urls": {
"Homepage": "https://github.com/hannesdelbeke/unreal-qt",
"Source": "https://github.com/hannesdelbeke/unreal-qt"
},
"split_keywords": [
"application",
"unreal",
"pyside",
"pyqt",
"qt",
"engine",
"unrealengine"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2c54116bae62d607ae3ce5a866b18ebf7bf0006988e999fd1c5955fef48a95d5",
"md5": "a241ab80df2f80f59454ef26de6bee0b",
"sha256": "56a4b0a8475e074aae91151a212b45d40f763b6916283187b1d2b40a43ec72fe"
},
"downloads": -1,
"filename": "unreal_qt-0.0.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a241ab80df2f80f59454ef26de6bee0b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.4",
"size": 6319,
"upload_time": "2023-07-04T14:53:22",
"upload_time_iso_8601": "2023-07-04T14:53:22.255743Z",
"url": "https://files.pythonhosted.org/packages/2c/54/116bae62d607ae3ce5a866b18ebf7bf0006988e999fd1c5955fef48a95d5/unreal_qt-0.0.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "8199fbe1614c550bfc971183d842d72834a8ca5fd70ab39a898aa0730bc63f4b",
"md5": "573875bf86c6dfce54742f22f65c334a",
"sha256": "0a3640a842074786f278f51dab6e96308ec9bd961a6f6568a104185cf75cd641"
},
"downloads": -1,
"filename": "unreal-qt-0.0.1.tar.gz",
"has_sig": false,
"md5_digest": "573875bf86c6dfce54742f22f65c334a",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.4",
"size": 11416,
"upload_time": "2023-07-04T14:53:23",
"upload_time_iso_8601": "2023-07-04T14:53:23.803707Z",
"url": "https://files.pythonhosted.org/packages/81/99/fbe1614c550bfc971183d842d72834a8ca5fd70ab39a898aa0730bc63f4b/unreal-qt-0.0.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-04 14:53:23",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "hannesdelbeke",
"github_project": "unreal-qt",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"lcname": "unreal-qt"
}