change append child method
This commit is contained in:
parent
69e550886b
commit
9f1839f2f7
@ -40,4 +40,9 @@ SwipeView {
|
|||||||
onBorderColorChanged: {
|
onBorderColorChanged: {
|
||||||
bg.border.color = borderColor
|
bg.border.color = borderColor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
onCurrentIndexChanged: {
|
||||||
|
console.log(tag, uuid + " onCurrentIndexChanged: " + this.currentIndex)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -67,6 +67,10 @@ void DoricSliderNode::afterBlended(QJsonValue prop) {
|
|||||||
QJsonDocument document = QJsonDocument::fromJson(jsValueString.toUtf8());
|
QJsonDocument document = QJsonDocument::fromJson(jsValueString.toUtf8());
|
||||||
QJsonArray jsValue = document.array();
|
QJsonArray jsValue = document.array();
|
||||||
|
|
||||||
|
QQmlListProperty<QQuickItem> contentChildren =
|
||||||
|
qvariant_cast<QQmlListProperty<QQuickItem>>(
|
||||||
|
mView->property("contentChildren"));
|
||||||
|
|
||||||
for (int i = 0; i != jsValue.size(); i++) {
|
for (int i = 0; i != jsValue.size(); i++) {
|
||||||
QJsonValue model = jsValue.at(i);
|
QJsonValue model = jsValue.at(i);
|
||||||
QString id = model["id"].toString();
|
QString id = model["id"].toString();
|
||||||
@ -77,7 +81,7 @@ void DoricSliderNode::afterBlended(QJsonValue prop) {
|
|||||||
newNode->init(this);
|
newNode->init(this);
|
||||||
|
|
||||||
this->childNodes.append((DoricSlideItemNode *)newNode);
|
this->childNodes.append((DoricSlideItemNode *)newNode);
|
||||||
newNode->getNodeView()->setParentItem(mView);
|
contentChildren.append(&contentChildren, newNode->getNodeView());
|
||||||
|
|
||||||
newNode->blend(model["props"]);
|
newNode->blend(model["props"]);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user