// SoQt header files
#include <Inventor/Qt/SoQt.h>
#include <Inventor/Qt/viewers/SoQtExaminerViewer.h>

// Coin header files
#include <Inventor/nodes/SoBaseColor.h>
#include <Inventor/nodes/SoText3.h>
#include <Inventor/nodes/SoSeparator.h>

int main(int argc, char **argv)
{
// Initialize SoQt library.
// The return value points to a Qt window
QWidget *window = SoQt::init("test");

// Create a "scene graph"
SoSeparator *root = new SoSeparator;
root->ref();

// Set the RGB color. Yellow in this case
SoBaseColor *color = new SoBaseColor;
color->rgb = SbColor(1, 1, 0);
root->addChild(color);

// Create a text
SoText3 *text3D = new SoText3();
text3D->string.setValue("Hello SoQt");
root->addChild(text3D);

// Create a viewer
SoQtExaminerViewer *b = new SoQtExaminerViewer(window);
b->setSceneGraph(root);
b->show();

// Start the window
SoQt::show(window);
// Loop until exit.
SoQt::mainLoop();

// Delete viewer and reference for scene
delete b;
root->unref();

return 0;
}
