[osg-users] Qt4, OSG and HUD

255 views
Skip to first unread message

Eric ZAREMBA

unread,
Aug 14, 2008, 7:54:09 AM8/14/08
to osg-...@lists.openscenegraph.org

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.

 

main.cpp
QOSGGraphics.cpp
QOSGGraphics.h

Johan Nouvel

unread,
Aug 18, 2008, 11:00:12 AM8/18/08
to OpenSceneGraph Users
Hi Eric,

Thanks for the example.

We are using OSG in QT application with some GUI over the OSG 3D rendering widget. QT version is 4.3.X but we want to
move to QT 4.4.X.

With your code, I will spare time. Thanks.

Johan.

Eric ZAREMBA a écrit :


> 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.
>

...


>
> I hope this could be usefull for someone.
>
> Eric Z.
>
>
>
>

> ------------------------------------------------------------------------
>
> _______________________________________________
> osg-users mailing list
> osg-...@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


--
Johan Nouvel, R&D Project Manager
http://www.archivideo.com
tel : +33 (0)2 99 86 30 20
ARCHIVIDEO, 40 rue des Veyettes, 35000 RENNES, FRANCE
_______________________________________________
osg-users mailing list
osg-...@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

René Molenaar

unread,
Aug 18, 2008, 7:26:05 PM8/18/08
to OpenSceneGraph Users
Nice,

i will check it out, i just read the article too.
thanks!

Rene

2008/8/18 Johan Nouvel <opensce...@archivideo.com>

René Molenaar

unread,
Aug 19, 2008, 7:17:03 AM8/19/08
to OpenSceneGraph Users
I compiled and run the examples, it might become useful. Thanks!
I did notice a similar problem with the other two versions (AdapterWidget and QOSGWidget),
after you resize your height to zero pixels, the scene is missing...
I worked around this by having the resize function set always a minimum of one pixel,
it seems like a bug in osg.

Rene

2008/8/19 René Molenaar <megamil...@gmail.com>
Reply all
Reply to author
Forward
0 new messages