Hi, I have been trying to modify the osgViewerQtWidget example which has a composite viewer embedded as a widget in a Qt main window.
I want to use a single Viewer instead and am thus far not successful. My Qt ui is a simple main window with the central widget upgraded to a ViewerQOSG widget. I've attached my ViewerQOSG class for reference. My problem: In composite viewer we use the ViewQOSG class to 'add views' to the composite viewer. How does that translate to using a simple osgViewer::viewer? I am doing the following in my main function: Code: //..initializing application, loading files etc.... app.connect( &app, SIGNAL(lastWindowClosed()), &app, SLOT(quit()) ); osg::ArgumentParser arguments(&argc, argv); QPointer<OSGWindow> mainWindow = new OSGWindow(); //using the promoted widget GraphicsArea which is a ViewerQOSG osg::ref_ptr<ViewerQOSG> viewerWindow = mainWindow->ui.GraphicsArea; //viewerWindow->setCameraManipulator(new osgGA::TrackballManipulator); viewerWindow->setSceneData(Spaceship); //this line gives a lot warnings but makes the viewer to be within the //widget's area viewerWindow->setUpViewerAsEmbeddedInWindow(mainWindow->x(), mainWindow->y(), mainWindow->width(), mainWindow->height()); viewerWindow->frame(); mainWindow->show(); return app.exec(); If any one can tell me what I am doing wrong, I would greatly appreciate. Thank You. Sincerely, Sanat. ------------------ Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=39256#39256 Attachments: http://forum.openscenegraph.org//files/viewerqosg_176.cpp http://forum.openscenegraph.org//files/viewerqosg_145.h _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org