'Integration of Qml into Qwidget application getting error finding matching FBConfig (8 8 8 0)

I have written very basic qml application and trying to add into existing application which is using Qwidget and create window using QMainWindow and widget. Using PySide2

qt.glx: qglx_findConfig: Failed to finding matching FBConfig (8 8 8 0)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (1 8 8 0)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (1 1 8 0)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (1 1 1 0)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (1 1 1 0)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (1 1 1 0)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (1 1 1 0)
qt.glx: qglx_findConfig: Failed to finding matching FBConfig (1 1 1 0)
WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported!  This is an application bug!
QSGContext::initialize: stencil buffer support missing, expect rendering errors

qml code: Rectangle { id: page width: 320; height: 480 color: "lightgray"

Text {
    id: helloText
    text: "Hello world!"
    y: 30
    anchors.horizontalCenter: page.horizontalCenter
    font.pointSize: 24; font.bold: true
}

}

qt code:

def create_sidebar(self):
        """
        creating sidebar
        :return:
        """
        self.slidebar = QQuickWidget()
        self.slidebar.setSource(QUrl.fromLocalFile("sidebar.qml"))
        self.vbox.addWidget(self.slidebar)


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source