Comments (12)
@Papoun reopening the issue, as it looks like a new revamp of QT for python is coming and i would like to support it in the best possible way
from unrealenginepython.
sorry, fixed
from unrealenginepython.
Any news on this one? 🤔
from unrealenginepython.
What kind of argument type Qt expects for the window handle ?
from unrealenginepython.
We will want the integer for the Unreal HWND.
After that, in python, we will need to create an invisible Qt proxy parent widget which is parented to the Unreal window using win32gui methods. The invisible Qt proxy parent widget will then act as the main window parent for future widgets.
from unrealenginepython.
@rdeioris have a look at this example, it might be helpful
https://github.com/alfalfasprossen/qtinwin/blob/master/maxparenting.py
from unrealenginepython.
@sinokgr i have added this:
import unreal_engine as ue
root_window = ue.get_editor_window()
ue.log(root_window.get_window_handle())
i think it should be enough for you
from unrealenginepython.
worked fine! Thanks! 😀
from unrealenginepython.
Hi @rdeioris, I just downloaded and re-compiled the latest version with levels support and it looks like this stopped working. Have you accidentally deleted this line of code or is intentional?
from unrealenginepython.
Bumping this one ^^' Not sure if i need to create a new thead ? sorry if that's the case !
How are you setting the UE window as a parent of a QtWidget, @sinokgr ?
I haven't been able to get the unreal window from it's hwnd (using ue.get_editor_window().get_handle()
for the hwnd) with Ctypes (PyCObject_AsVoidPtr is deprecated in 3.6 when trying a similar approach to the 3DS Max parenting one) or the win32gui one.
Thanks !
from unrealenginepython.
An update on this. You can get the handle of the ue4 editor window with ctypes like so :
handle = ctypes.windll.user32.GetForegroundWindow()
And use the windll's SetParent to set the Qt widget (self) as a child of the unreal editor window :
ctypes.windll.user32.SetParent(self.winId(), handle)
A few issues arise from this though. You cant for instance move the Qt widget outside of ue4 like a regular unreal window/tab. This can be pretty annoying if the user tries to move the Qt window on another screen or outside of the unreal window geometry.
I ended up resorting to a simpler method where im using a thread to monitor the current foreground application, but would really like to see if the problems above still persist with different methods !
from unrealenginepython.
Closing it as now we have the set_as_owner() api function:
https://github.com/20tab/UnrealEnginePython/blob/master/README.md#integration-with-qt4qt5pyside2
from unrealenginepython.
Related Issues (20)
- upgrade python console to IPython or other alternatives?
- Error with module h5py
- 4.26.2 Python 3.7 Crash When call bind_event in uep HOT 2
- How to add force to pyactor HOT 1
- keyboard input HOT 2
- Where are the python modules? HOT 1
- Build Failed: Cannot open include file 'UEPyModule.h'
- seems not work at 4.27?
- How can I redirect a python class so that the engine can recognize him?(请问如何重定向一个python类,然后引擎能够识别他?)
- Spawn a pyactor in begin_play doesn't works fine.
- First demo in docs/Http_API.md cause the editor crashed in 4.27.2
- Great content! It might be possible to create an updated version (ue5) HOT 1
- How to call Python automation code from a UI button? HOT 4
- How do I get text from a UEditableTextBox?
- How to run a simple python function, with inputs & outputs, from blueprints? HOT 5
- I am using multithreading to Spawn a Blueprint Actor and Unreal Engine is crashing suddenly when the spawn function gets called.
- consider archiving the repo in github
- how can I change my python env in my own source(python3.8),rather then the give source(python3.6 in UnrealEnginePython/)
- a
- Issues about the HouseKeeper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unrealenginepython.