I am using OSG with QT......Made the OSG viewer in QWidget Layout as
QGridLayout. My model is vanished, not seen. Please tell me what I am doing
wrong.

For creatting the view in Qt my code is below

////////////////////////////////////////////////////////////
CSGroup* root = new CSGroup();
ViewerWidget* viewWidget = new
ViewerWidget(m_Modelling_Designs->m_TabWidget->widget(0), root, fileName) ;
QGridLayout *layoutForModel = new QGridLayout;
layoutForModel->addWidget(viewWidget);
m_Modelling_Designs->m_TabWidget->widget(0)->setLayout(layoutForModel);
viewWidget->show();
////////////////////////////////////////////////////////////////////////////////////////////////////////////

For adding model into scene snippet is below.
///////////////////////////////////////////////////////////////////////////////////////
osg::ref_ptr<osg::Node> axes =
osgDB::readNodeFile("C:\\SUJAN_C_DRIVE\\OSG_DATA\\OpenSceneGraph-Data-3.0.0\\axes.osgt");
 scene->addChild( axes);

              gView = (CSGraphicsView*) (addViewWidget(
createCamera(0,0,-0.5,0.5), scene ));

              QGridLayout* grid = new QGridLayout;
              grid->addWidget( gView, 0, 0 );
               setLayout( grid );
///////////////////////////////////////////////////////////////////////////////////////

Please help why my model is not appearing. Thanks in advance.

-- 
Thanks & Regards
Sujan
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to