Hi Dario,
The way I've gotten around that problem was to do the OSG/Qt integration a
little differently.
For your 3D Wiget, the header should be:
Code:
class QtOSGWidget : public QWidget, public osgViewer::Viewer
{
...//
//make sure to override the paint event
};
Then in the constructor do the following, where timer is a QTimer:
Code:
connect(&timer, SIGNAL(timeout()), this, SLOT(update()));
timer.start(20);
Now this is probably the most important part. After adding the camera of your
choice, inside the constructor:
Code:
osgQt::GraphicsWindowQt *gw =
dynamic_cast<osgQt::GraphicsWindowQt*>(this->getCamera()->getGraphicsContext()
); //return the openGL widget back to Qt
QGridLayout* grid = new QGridLayout();
grid->addWidget(gw, 0, 0);
setLayout(grid);
I think this is what you're looking for. This way the timer connection will
call the paintEvent(..). Inside the paint event you call the frame() function.
This will prevent any segmentation faults from being discovered, because it's
always maintaining a 1:1 update call.
Hope this helps,
Braden Edmunds
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=55123#55123
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org