Working Qt controls in a 3d environment
Posted
by
Jay
on Game Development
See other posts from Game Development
or by Jay
Published on 2012-12-19T19:51:45Z
Indexed on
2012/12/19
23:15 UTC
Read the original article
Hit count: 189
I need some advice from a Qt expert.
The background: I have a 3D engine (ogre3d) working in concert with Qt. The 3D Content is displayed in a widget (using a custom OS window in the client area). I'm able to overlay arbitrary Qt widgets onto the 3d world using the widget render() method and a shared bitmap. This makes a great "heads up display". I can use the standard Qt style sheets and animation using this technique.
My goal I'd like to go a step further and allow the user to move these rendered widgets using the mouse. I'd like some advice on the best way to implement this.
Possible solutions:
- The widgets in the HUD are not part of the inheritance chain. I render them manually. They don't get events though. I could add them to the inheritance chain so they get events in the usual way. Then I would need to change them to render to my shared bitmap instead of to the operating system. I looked at this once but couldn't find enough information to implement it.
- Capture mouse events in the 3D display widget and EMIT them to child controls. I basically create my own event handling chain.
Any suggestions on how to implement this?
I'm also considering switching to Qt5. I'm not sure how that might affect this decision.
© Game Development or respective owner