title: How use QML Drawer with Qt Widgets?
body: <p>I would like to know how could I make the QApplication UI the root window of a QML Drawer item on a PyQt5 project. </p>
  
  <p>In principle, I am capable of making them work together but the Drawer keeps displaying on a different window instead of applying the same effect to the root window. </p>
  
  <p>Just as an example, I was trying to include the functionality of the "<a href="https://doc-snapshots.qt.io/qt5-5.11/qtquickcontrols2-gallery-example.html" rel="nofollow noreferrer">Qt Quick Controls 2 - Gallery</a>" onto the project. </p>
  
  <p>Check the following code for further details:</p>
  
  <pre><code># mainwindow.py
  
  class MainWindow:
  
     def __init__(self):
        self.qtApplication = QtWidgets.QApplication([])
        qtPbObj = QtWidgets.QPushButton
        QtWidgets.QPushButton = hoverButton
  
        self.mw = QtWidgets.QMainWindow()
        self.mw.setWindowFlags(Qt.FramelessWindowHint | self.mw.windowFlags())
        self.qtMainWindowUi = main_ui.Ui_MainWindow()
        self.qtMainWindowUi.setupUi(self.mw)
        QtWidgets.QPushButton = qtPbObj
  
         ...
  
        engine = QQmlApplicationEngine()
  
        context = engine.rootContext()
        file = os.path.join(DIR_PATH, "main.qml")
        url = QUrl.fromLocalFile(file)    
        engine.load(url)
  
        engine.setParent(self.qtApplication.instance())
  
        if not engine.rootObjects():
           logger.error("No object could be loaded from sourced QML file")
           self.qtApplication.exit(-1)
  
        rootWindow = engine.rootObjects()[0]
  
  </code></pre>
  
  <p>The QML file used can be found <a href="https://doc-snapshots.qt.io/qt5-5.11/qtquickcontrols2-gallery-gallery-qml.html" rel="nofollow noreferrer">here</a>.</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p>In the project, while keeping the <strong>setupUi</strong> and <strong>frameless</strong> features implemented, I would like to have the QML Drawer functionality only available when clicking the "≡", so that it overlaps the MainWindow central_widget:</p>
  
  <p>Attached some captures to explain better the actual status: </p>
  
  <p><strong>Actual UI:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/Nt3H6.png" alt=""></p>
  
  <p><img src="https://i.stack.imgur.com/Jxibb.png" alt=""></p>
  
  <p><strong>Ideal solution:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/pldNU.png" alt=""></p>
  
  <p><img src="https://i.stack.imgur.com/dqIEz.png" alt=""></p>
  
  <p><img src="https://i.stack.imgur.com/PsLfA.png" alt=""></p>