[osg-users] [3rdparty] Combining OSG and Qt 5.4 architecture
michael kapelko
kornerr at gmail.com
Thu Apr 16 18:35:25 PDT 2015
You can set ViewerWidget as MainWindow's central widget, and that's it.
2015-04-15 15:38 GMT+07:00 Christian Kunz <christian.kunz83 at gmail.com>:
> Hello everyone,
>
> I have a question regarding the combination of OSG and Qt 5.4.
> I already combined my OSG application with Qt. I used the example which is
> shipped with OSG: "osgviewerQt".
> At the moment my OSG application is quite simple. Its a 3D scene with a
> animated 6 axis robot.
>
> I added my root node as explained in the example:
>
>
> Code:
>
> QApplication app( argc, argv );
> osgQt::GraphicsWindowQt* gw = createGraphicsWindow( 50, 50, 640, 480 );
>
> //osg::Node* scene = osgDB::readNodeFile("cow.osg");
> osg::Node* scene = root;
>
> ViewerWidget* widget = new ViewerWidget(gw, scene);
> widget->setGeometry( 100, 100, 800, 600 );
> widget->show();
> return app.exec();
>
>
>
> Then my scene is rendered in a Qt Widget.
>
> The problem with this solution is, that it is not a Qt mainWindow. Is
> there a way to add this ViewerWidget which is inherited from QWidget to a
> normal Qt form?
> The best would be that you can see a placeholder in the forms editor of Qt
> creator. Does anyone know an example which is more complex than
> "osgviewerQt"?
>
>
>
> ...
> Thank you!
>
> Cheers,
> Christian
> Code:
>
>
>
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=63403#63403
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150417/0b4aea48/attachment-0002.htm>
More information about the osg-users
mailing list