OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Combining OSG and Qt 5.4 architecture


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [3rdparty]
View previous topic :: View next topic  
Author Message
Fawkes
Newbie


Joined: 14 Apr 2015
Posts: 16

PostPosted: Wed Apr 15, 2015 8:38 am    Post subject:
Combining OSG and Qt 5.4 architecture
Reply with quote

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:
Back to top
View user's profile Send private message
kornerr
Appreciator


Joined: 01 Oct 2013
Posts: 230

PostPosted: Fri Apr 17, 2015 1:36 am    Post subject:
Combining OSG and Qt 5.4 architecture
Reply with quote

You can set ViewerWidget as MainWindow's central widget, and that's it.


2015-04-15 15:38 GMT+07:00 Christian Kunz < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
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
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [3rdparty] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts combining Quats Trajce Nikolov NICK General 5 Wed Feb 01, 2017 8:17 am View latest post
No new posts OSG & RTOS software architecture The_Dutchman General 4 Wed Sep 28, 2016 5:21 am View latest post
No new posts ld: symbol(s) not found for architect... mzu Build system [build] 0 Tue Mar 04, 2014 9:20 am View latest post
No new posts ld: symbol(s) not found for architect... mzu Build system [build] 0 Mon Dec 23, 2013 9:47 pm View latest post
No new posts Combining transformations and referen... Deniz Koçak General 0 Wed Nov 13, 2013 8:21 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP