| |
 |
|
|
Linux Forum Index » Linux Development - Applications » Mercury Open Inventor + Qt Designer soqtwidgetplugin...
Page 1 of 1
|
| Author |
Message |
| ... |
Posted: Tue Aug 19, 2008 4:46 am |
|
|
|
Guest
|
I'm using Mercury Open Inventor and Qt 4/Designer and could really use
a simple example of using the SoQtWidget plugin and the SoQtWrapper
class. Whatever I've tried, I haven't been able to change the default
contents ("Open Inventor by Mercury with Qt from Trolltech") of the
soqtwidgetplugin object. At best, what I'm trying to put in that
object just corrupts the main window...
(Programs that don't use the soqtwidgetplugin are fine.)
Thanks in advance!
Martin Beizer |
|
|
| Back to top |
|
| ... |
Posted: Tue Aug 19, 2008 5:48 am |
|
|
|
Guest
|
I got it! (At least it looks like it works.) I would welcome comments/
suggestions if there is a better way...
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
Test2 w;
// Make a scene containing a red cone
SoSeparator *root = new SoSeparator;
SoPerspectiveCamera *myCamera = new SoPerspectiveCamera;
SoMaterial *myMaterial = new SoMaterial;
root->ref();
root->addChild(myCamera);
root->addChild(new SoDirectionalLight);
myMaterial->diffuseColor.setValue(1.0, 0.0, 0.0); // Red
root->addChild(myMaterial);
root->addChild(new SoCone);
SoQtRenderArea *viewer = w.ui.soqtwidgetplugin->getViewer();
// Make myCamera see everything.
myCamera->viewAll(root, viewer->getViewportRegion());
viewer->setSceneGraph(root);
viewer->setTitle("VisTool!");
w.ui.soqtwidgetplugin->show();
viewer->show();
w.show();
return a.exec();
}
On Aug 19, 10:46 am, martinb0... at (no spam) gmail.com wrote:
Quote: I'm using Mercury Open Inventor and Qt 4/Designer and could really use
a simple example of using the SoQtWidget plugin and the SoQtWrapper
class. Whatever I've tried, I haven't been able to change the default
contents ("Open Inventor by Mercury with Qt from Trolltech") of the
soqtwidgetplugin object. At best, what I'm trying to put in that
object just corrupts the main window...
(Programs that don't use the soqtwidgetplugin are fine.)
Thanks in advance!
Martin Beizer |
|
|
| Back to top |
|
| |
|
Page 1 of 1
All times are GMT - 5 Hours
The time now is Thu Dec 04, 2008 4:42 pm
|
|