Setting object type property in QML from C++
问题 (Editted to add more context) I've started using QML and I'd like to set some sort of reference property on a QML type, linking two QML objects (ideally, without a parent/child relationship as I'd like to connect multiple QML objects). For example, I have the following files. qmldir: A 1.0 A.qml A.qml import QtQuick 2.2 Rectangle { width: 100 height: 100 color: 'red' // Other stuff later } main.qml: import QtQuick 2.2 import QtQuick.Window 2.1 import "qrc:/" Rectangle { objectName: "Main