-
Bug
-
Resolution: Done
-
P2: Important
-
Qt for MCUs 1.4
-
None
-
-
0
-
UL Sprint 3.7
If a custom control gets as property its parent item. The custom control can not anchor to that parent item, because it creates corrupted c++ code
root qml code test.qml
Rectangle {
id: parentRect
width: 1280
height: 720
Rect {
id: rect
parentRect: parentRect
width: 100
height: 200
}
}
custom qml control code Rect.qml
Rectangle{
id: rect
property Rectangle parentRect: Rectangle{}
anchors.horizontalCenter: parentRect.horizontalCenter
}
Genereated corrupted c++ code, Rect.cpp:
. . . int Rect::_x_anchor_bindingFunctor::operator()(Rect *self) const { struct horizontalCenter_funcFunctor { Rect *self; ItemBase::HorizontalAnchorLine operator()() const { Qul::Private::Items::ItemBase::HorizontalAnchorLine r2__horizontalCenter; Qul::Private::Items::Rectangle * r2; // anchors.horizontalCenter: parentRect.horizontalCenter // line 7 "Test/Rect.qml" r2 = self->parentRect.value(); r2__horizontalCenter = r2->horizontalCenterAnchor(); return r2__horizontalCenter; } } horizontalCenter_func = { self }; ItemBase::HorizontalAnchorLine horizontalCenter = horizontalCenter_func(); return horizontalCenter.valueFor(&self->) - ((self->width.value())/2); }; . . .