[osg-users] Qt5 integration

James Turner zakalawe at mac.com
Thu Aug 13 13:10:33 PDT 2015


I’ve been re-working the osgQt code to fit the Qt5 windowing model closer - I have a basic proof of concept working, which I will clean up and publish shortly. This provides an osgViewer backed by a QWindow; so the widget and opengl module dependency is gone, the only Qt5 modules needed are Gui and Core.

A QWindow can be embedded in a traditional widget based application using QWidget::createWindowContainer; I will create an example of this approach as part of my submission. (And the performance of this approach is the same as the old QGLWidget inside GraphicsWindowQt).

What I’d like to know, is what other uses cases are relevant for people:

- I could re-create QWidgetImage, but using QWidget::render and avoiding any reliance on QGraphicsScene or QGraphicsProxy. If people have uses cases for QWidgetImage, that would be good to know. Especially, are you embedding ‘a few buttons’ or entire application layouts? Correctly handling keyboard focus is obviously something that’s been difficult in the current code and I expect to be similarly awkward.

- QtQuick2 integration; I’ll create a custom QQ2 item which renders OSG via a framebuffer. This will allow an OSG scene to be integrated with QQ2 UI, with reasonable performance. I would welcome any input from people who need this, and your particular requirements, especially the API for binding the osg Scene to the QML item. But, see the next point:

- I /hope/ to create a GraphicsWindowQtQuick which allows the common case of an OSG scene, with a QQ2 scene overlaid. This has some complexities to support the different OSG threading models and context lifetime, but it feels like such a common and desirable use case it’s worth spending time on.

- does anyone have a use for an equivalent of QWidgetImage for QtQuick2? I.e a chunk of QQ2 content displayed as a texture.

My intention would be to have any new classes live alongside the existing Qt4 support, since I don’t want to touch that code at all, for fear of regressing some aspect of the Qt4 support which someone may be relying upon in existing code.

If you have thoughts in this area, interesting requirements which might guide my approach, or test-case you can share, please let me know. I will definitely  be doing the basic pieces outlined above, but whether I work on the QWidgetImage piece in particular depends very much on what response I get.

Kind regards,
James Turner

More information about the osg-users mailing list