when I embed the Squircle into a Rectangle element (or any other element) it will not act as the child element but like a background root element.
That sounds like the expected behavior. From the link above:
The OpenGL under QML example shows how an application can make use of the QQuickWindow::beforeRendering() signal to draw custom OpenGL content under a Qt Quick scene. This signal is emitted at the start of every frame, before the scene graph starts its rendering, thus any OpenGL draw calls that are made as a response to this signal, will stack under the Qt Quick items.
If the goal is something that renders over the scene, look at the QQuickWindow::afterRender* signals instead of beforeRender*.
While not mentioned in the text, the code for Squircle::sync() and SquircleRenderer::paint() demonstrate using the window rather than the QObject or QQuickItem parent to size the Squircle. This can be changed by altering the calls to SquircleRenderer::setViewportSize() and glViewport().
when I mixed the openscenegraph frame() function into the SquircleRenderer::paint on the signal of QuickWindow::beforeRenderPassRecording the new element will cover the original Text element which is a child of the elemnet.
I don't understand how the new element, original Text, and child are oriented. QML code would make it easier to follow.
With no familiarity of OpenSceneGraph, I won't speculate other than to say that the image looks like a failure to save or restore state.
I tried to build gstreamer 1.22.7 + Qt 6.6 from the source. Because Qt 6.6 is installed under /opt, the include path of Qt is not set properly in gstreamer build script and the build of examples in plugin-good failed. Also tried to disable examples build in plugin-good and could not do it.
It seems that qml6 sink build is not enabled automatically. I enabled it manually and the build of gstreamer did include qml6 sink. I guess the build script of gstreamer still has some issues with Qt. It is likely that qml6 sink build may work with the Qt6 within the distribution of Linux. Have not tried it yet.
What are you passing to createObject as an argument? Normally there'd be a parent object, and the created object would be kept for as long as the parent is there to reference it. But if you don't supply a parent then the created object would potentially be garbage collected as soon as dlg goes out of scope.
I might be misunderstanding your last point, but anyway: it's true that your dlg.closeddoes have a reference to dlg... but it's a circular reference and the garbage collector knows how to deal with those, The real test is whether the object can be reached from the application's root object.
Solution works! We personally just made a custom component that takes desired height, divides that into width to maintain aspect ratio, and is easy to expose a bunch of times without all this boiler plate.
Of note, the width/height set is essential, because without it, changing the source during runtime (say if a target image needed to switch from a nondirectional to right) causes an additional instance of the image to spawn. See image below
// Need to include this as shown in original post
Otherwise we get the huge version that clips out. Note: I set onSourceChanged to set color to red, so we have an idea of what the original one is and which is the artifact.