That's way to complicated.

Just use the QQmlApplicationEngine with a Window in the QML file or a QQuickWindow.

In either case prepare a QObject derived class as the interface that your C++ offers to QML.
Create an object of that class before loading the QML into the engine/view and set it via the root context's setContextPropery() method.

Any slot or Q_INVOKABLE marked method on that object can then be called from QML.

Cheers,
_