I have created two instances of Squircle(openglunderqml) item

First instance have size 500,500 alignment in center to screen

ex:Mini Player in preview

Second instance have size of screen size alignment to complete screen

ex:Main Player in viewer

Initially Main Player does noting will goto preview there we can see mini player user say ok will launch main player

But during preview I could not see mini player because main player glviewport covering complete screen and its clearing because paint is getting alway its is connected to beforeRendering signal

code:
http://doc.qt.io/qt-5/qtquick-sceneg...l-example.html

I followed above link and made small change glviewport according to instance boundary
Qt Code:
  1. glViewport(m_viewportSize.x(), m_viewportSize.y(), m_viewportSize.width(), m_viewportSize.height());
To copy to clipboard, switch view to plain text mode 

glclear update
Qt Code:
  1. glClearColor(0, 0, 0, 1);
  2.  
  3. glScissor(m_ViewportSize.x(),m_ViewportSize.y(), m_ViewportSize.width(), m_ViewportSize.height());
  4.  
  5. glEnable(GL_SCISSOR_TEST);
  6. glClear(GL_COLOR_BUFFER_BIT);
  7. glDisable(GL_SCISSOR_TEST);
To copy to clipboard, switch view to plain text mode 
main.qml
Qt Code:
  1. import QtQuick 2.0
  2. import OpenGLUnderQML 1.0
  3.  
  4. Item {
  5. width: 1200
  6. height: 600
  7. Test{
  8. width: 500
  9. height: 500
  10. anchors.centerIn: parent
  11. color: "green"
  12. }
  13. Test{
  14. width: parent.width
  15. height: parent.height
  16. anchors.top: parent.top
  17. anchors.left: parent.left
  18. color: "red"
  19. }
  20. }
To copy to clipboard, switch view to plain text mode 
Test.qml
Qt Code:
  1. import QtQuick 2.0
  2. import OpenGLUnderQML 1.0
  3.  
  4. Rectangle {
  5.  
  6. opacity: 0.2
  7. Squircle {
  8. SequentialAnimation on t {
  9. NumberAnimation { to: 1; duration: 2500; easing.type: Easing.InQuad }
  10. NumberAnimation { to: 0; duration: 2500; easing.type: Easing.OutQuad }
  11. loops: Animation.Infinite
  12. running: true
  13. }
  14. }
  15. //! [1] //! [2]
  16. Rectangle {
  17. color: Qt.rgba(1, 1, 1, 0.7)
  18. radius: 10
  19. border.width: 1
  20. border.color: "white"
  21. anchors.fill: label
  22. anchors.margins: -10
  23. }
  24.  
  25. Text {
  26. id: label
  27. color: "black"
  28. wrapMode: Text.WordWrap
  29. text: "The background here is a squircle rendered with raw OpenGL using the 'beforeRender()' signal in QQuickWindow. This text label and its border is rendered using QML"
  30. anchors.right: parent.right
  31. anchors.left: parent.left
  32. anchors.bottom: parent.bottom
  33. anchors.margins: 20
  34. }
  35. }
To copy to clipboard, switch view to plain text mode 
[/code]