Currently, I am developing a Qt class that needs to be integrated in a C++ Visual Studio project.
Qt project - Qt Widgets Application. Build on Qt Creator 3.2.1 (opensource), based on Qt 5.3.2. Using Visual Studio 2013 Professional, the Qt Addin installed.
I tried the solutions from all over the Internet or from other Stack posts but without success. I don't see my post as a duplicate since the other posts didn't solve my problem.
I was able to run the QML from code, but it launches on a different window. In the first picture the QML window (Qt canvas) is shown over my program UI.
I need to integrate the QML into my program UI. I can use a QGraphicsView
if it helps.
Simple QML example. canvas.qml
import QtQuick 2.0
Rectangle {
id: rectangle
color: "red"
width: 600
height: 600
}
Please have a look at a part of MVC implementation in my project. Here is a class to visualize a QML code in Qt5.6. Hope it helps.
To manage controllers I have Gui director class with the following implementation :