Solved Assign QML component to inner QML component. How?
-
Hello!
I have the custom QML component that have few inner components CustomComponent.qml:// System includes import QtQuick 2.15 import QtQuick.Controls 2.15 // Component Rectangle { id: oWrapper; width: x; height: y; Rectangle { id: oContent; color: "red"; width: parent.width; height: parent.height; } }
The question is how do add another one QML component when to inner Rectangle when I am using CustomComponent.qml?
CustomComponent { Rectangle { id: oObject1; color: "blue"; width: 10; height: 10; } }
In this example the QML component oObject need to be added to oContent but not oWrapper.
-
-
@LeLev said in Assign QML component to inner QML component. How?:
Use the highest voted answer, not the accepted one with the
Loader
. -
Thx to all. Issue closed. Solution found. Example published https://github.com/ArboreusSystems/arboreus_examples/tree/master/qt/QML/CustomComponent/CustomComponent_v1