[osg-users] Qt5 integration

James Turner zakalawe at mac.com
Mon Aug 24 07:03:52 PDT 2015

> On 17 Aug 2015, at 17:33, Riccardo Corsi <riccardo.corsi at kairos3d.it> wrote:

Thanks Ricky.

> From my point of view the most desired feature is to be able to integrate a qt scene (a GUI layout or a browser/pdf/svg viewer widget) inside an osg driven application smoothly - i.e. without the need of a Qt application to run as main thread loop, but hiding it as a "slave" somewhere in an osg module/node, to make those widget pluggable in a "regular" osg application.

As someone else pointed out, this is a less common scenario for what I’m trying to support. What I care more about is people who want to use Qt for the thing it’s good at, and integrate OSG within it. So they typically want menus, dialogs etc from QWidgets or QQ2 (potentially including Qt Quick Controls). That’s the use case I’m focusing on for now.

Hiding Qt introduces a lot of complexity and also trades that rather detailed, tailored Qt event loops on each platform, for the rather basic ones in each of the GraphicsWindow subclasses. 

> Instead if you're interested, a while ago I coded an integration to render with osg inside a QtQuick+QML application.
> Basically the solution implements a custom QtQuick node which renders an osgViewer scene to an FBO, and then copies the FBO contents back to the Qt context, to make it available in the qt/qml scenegraph which renders the widgets.
> The osgQuickNode uses a separate OpenGL context, not to interfere with the one used by Qt for its own scene rendering. 
> All the code is here: https://github.com/rickyviking/qmlosg <https://github.com/rickyviking/qmlosg>
> If you have questions about the implementation feel free to write me.

The solution you propose of a custom QtQuick node rendering OSG is definitely interesting to me, and I would guess your code is likely 90% the same as what I would write, so with your permission I might attempt to merge it with my submission, once I have time to review it.

Kind regards,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150824/b8937db3/attachment-0003.htm>

More information about the osg-users mailing list