Re: [osg-users] osgQt::GraphicsWindowQt parent parameter

2012-10-19 Thread Gianni Ambrosio
Hi,
there may be a bug in osgQt::GraphicsWindowQt(osg::GraphicsContext::Traits* 
traits, QWidget* parent = NULL, const QGLWidget* shareWidget = NULL, 
Qt::WindowFlags f = 0) constructor.

Anyway I solved as follows: basically using the other GraphicsWindowQt 
constructor available and creating a GLWidget from my own (so that I can also 
use the forwardKeyEvents parameter otherwise impossible to set).

Here is the code:

Code:
QGLFormat format = osgQt::GraphicsWindowQt::traits2qglFormat(traits);
osgQt::GLWidget* glwidget = new osgQt::GLWidget(format, this, 0, 0, true);
camera-setGraphicsContext(new osgQt::GraphicsWindowQt(glwidget));




Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50673#50673





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


[osg-users] osgQt::GraphicsWindowQt parent parameter

2012-10-18 Thread Gianni Ambrosio
Hi,
I found that in OSG 3.0.1 a parent paramter has been introduced to 
GraphicsWindowQt constructor. I would like to use that parameter but if I pass 
a parent widget the 3d canvas disappear and I see just a grey widget. It can be 
easily reproduced with osgViewerQt example: just use this as parent in the 
following line:

camera-setGraphicsContext( new osgQt::GraphicsWindowQt(traits.get(), this));

Could somebody explain me please the reason?

Regards,
Gianni

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=50666#50666





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