В настоящее время я разрабатываю класс Qt, который необходимо интегрировать в проект C++ Visual Studio.
Проект Qt — Приложение Qt Widgets. Сборка на Qt Creator 3.2.1 (с открытым исходным кодом), основанная на Qt 5.3.2. Используя Visual Studio 2013 Professional, установил надстройку Qt.
Я пробовал решения со всего Интернета или из других сообщений Stack, но безуспешно. Я не вижу свой пост как дубликат, так как другие посты не решили мою проблему.
Мне удалось запустить QML из кода, но он запускается в другом окне. На первом рисунке окно QML (холст Qt) показано поверх пользовательского интерфейса моей программы.
Мне нужно интегрировать QML в пользовательский интерфейс моей программы. Я могу использовать QGraphicsView
, если это поможет.
Простой пример QML. canvas.qml
import QtQuick 2.0
Rectangle {
id: rectangle
color: "red"
width: 600
height: 600
}