2

I'm kind of newbie in both OSG and Qt, still I'm trying to make Qt HUD upon my OSG window, what I want is Qt interface elements fixed inside OSG scene, not spinning with the model. The thing is, I need Qt elements INSIDE osg scene, not OSG scene inside Qt window (like in OSGviewerQt example).

What I've got yet is OSGQtWidgets example with --useWidgetImage --fullscreen arguments, which shows fixed Qt controls ontop of OSG Model. The thing is, it creates new (FIXED) camera for qt element ontop of OSG model -- because of that, user cannot spin and move OSG model because camera is not transparent.

So the question is: is there a way to make transparent camera with useable Qt elements in it? Or is there some other way to achieve my goals?

Thank you in advance!

Kilazi
  • 308
  • 3
  • 14
  • I'm confused, if you want a HUD, why would you want Qt 'elements' (like what?) _inside_ the OSG scene? Surely you want them laid over the top, oblivious to camera data. – cmannett85 Aug 16 '12 at 07:58
  • thanks for quick reply; needed Qt elements -- buttons, tree-views etc; I want them _inside_ OSG scene because there is OSGWidget interface at this moment in the project I'm working with, and it would be nice to change it from OSGWidget to Qt; therefore, it seems much easier to change to Qt controls _inside_ scene, when using something as in OSGViewerQt example would be like writing completely new ui – Kilazi Aug 16 '12 at 08:19

1 Answers1

1

I am unable to try this out for myself first, but you can try setting a property on the Orthogonal "HUD" camera to let events pass through to the regular OSG viewer:

camera->setAllowEventFocus(false);

If you're using a recent version of osgQtWidgets.cpp, you'd want to add this around line 414.

Chris
  • 452
  • 3
  • 14
  • Thanks for your reply, but it didnt work out. Though even if it did, my Qt control would become unclickable, wouldnt it? – Kilazi Aug 28 '12 at 06:33