Hi Martin,
I looked at your osgWindowWidget example, it worked great, but now if i
want to add qml on top of the osgViewer i get an opaque window. What i did was
in your example i added a QQuickView, formed a windowHolderWidget from it with
parent as the osgWidget. Here is the code.
Code:
QApplication a(argc, argv);
Window w;
w.viewer()->setSceneData(osgDB::readNodeFile("cow.osg"));
w.viewer()->setCameraManipulator(new osgGA::TrackballManipulator);
QQuickView view;
view.setSurface(QSurface::OpenGLSurface);
view.setSource(QUrl::fromLocalFile("example.qml"));
QSurfaceFormat surfaceFormat;
surfaceFormat.setAlphaBufferSize(8);
surfaceFormat.setRenderableType(QSurfaceFormat::OpenGL);
view.setFormat(surfaceFormat);
view.setColor(QColor(Qt::transparent));
view.setClearBeforeRendering(true);
//view.setParent(&w);
//view.show();
WindowHolderWidget myWidget, menuWidget;
myWidget.setEmbeddedWindow(&w);
menuWidget.setEmbeddedWindow(&view);
menuWidget.setStyleSheet("background:transparent;");
menuWidget.setAttribute(Qt::WA_TranslucentBackground);
menuWidget.setWindowFlags(Qt::FramelessWindowHint);
menuWidget.setParent(&mywidget);
QWidget mainwidget;
mainwidget.resize(600,600);
mainwidget.setLayout(new QVBoxLayout());
QSlider slider(Qt::Horizontal);
slider.setRange(0, 255);
mainwidget.layout()->addWidget(&slider);
mainwidget.layout()->addWidget(&mywidget);
QObject::connect(&slider, SIGNAL(valueChanged(int)), &w,
SLOT(setBackgroundColorRed(int)));
mainwidget.showMaximized();
return a.exec();
Would it be possible to render a transparent qquickview.
Thank you!
Cheers,
Nitish
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=52045#52045
Attachments:
http://forum.openscenegraph.org//files/osgwindowwidget_136.rar
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org