Hi all,

 

Since Qt 4.4, we are able to mix OpenGL and Qt in a way which provides
more possibility than the osgViewerQT do by using QGraphics framework,
especially for HUD display.

I joint the example I write to do this.

 

The main function loads a model a display into my QGraphicsScene
inheriting class.

On top of it is drawn a simple semi-transparent QWidget but we can draw
whatever we want as menu...

 

I extended the example code from the Qt Quaterly to use the osg::Viewer.

But I think it can interest other Qt/OSG users.

 

I still have 2 problems I don't have the time to look forward:

- The widget transparency only run with the composite viewer (run my
example with the --composite argument)

- The window resize produces a deformation of widgets inside but I think
it more a Qt problem ;) I say this just for information.

 

I hope this could be usefull for someone.

Eric Z.

 

Attachment: main.cpp
Description: main.cpp

Attachment: QOSGGraphics.cpp
Description: QOSGGraphics.cpp

Attachment: QOSGGraphics.h
Description: QOSGGraphics.h

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to