Hi,
I have tested the integration between Qt GraphicsView and OSG too.
To have better results, don't use drawBackground() to do OSG drawing but
overload the paint event of QGraphicsView, somthing like that :
void MyGraphicsView::paintEvent( QPaintEvent* event )
{
QGLWidget* widget = dynamic_cast<QGLWidget*>( viewport() );
if (widget)
{
widget->makeCurrent();
getCanvas()->frame();
}
QGraphicsView::paintEvent( event );
}
Using drawBackground() is a bad idea because Qt has already initialized
some OpenGL state for its needs.
I have much better result this way. I still have some problems when
using osgEphemeris. Mixing Qt and OSG rendering in the same OpenGL
context does not seems very robust.
Maybe it is needed to "clear" OSG state before calling
QGraphicsView::paintEvent() but i stop my investigations there.
Hope that helps
Fabien
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Yvon
Halbwachs
Sent: mercredi 5 novembre 2008 15:49
To: [email protected]
Subject: Re: [osg-users] Displaying a scene in the background ofa
QGraphicsView
Hi everybody,
I managed to use osg in a Qt QGraphicsView with the information that
Eric Zeremba and Rene Molenaar posted some weeks ago. I still have some
troubles though... Things work fine when I display the "cow.osg" scene
from the OpenSceneGraph example files, but nothing is displayed when I
use "cessna.osg". The only way to display it is to enable display lists
(it is set to false by default).
Anybody has a clue about what's going on?
Yvon
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org