здесь в коде я вызываю два списка с одним и тем же делегатом.первый просмотр списка должен вызываться только один раз. передаваемое мной значение должно обновляться при втором просмотре списка
, пожалуйста, предлагайте любые изменения.
first.qml
Component
{
id: customDelegate
Loader
{
id: delegateLoader
sourceComponent:
{
if (counter >= 1 )
{
return multipleDelegate;
}
}
Binding
{
id: standardBinder
target: delegateLoader.item
property: "model"
value: model
when: delegateLoader.status === Loader.Ready
}
}
}
Delegate{id: multipleDelegate}
ListView
{
id: firstField
width: parent.width
delegate: customDelegate
model: filterModel
interactive: false
}
ListView
{
id: lastField
width: parent.width
delegate: customDelegate
model: filterModel
interactive: false
}
thisмой файл делегата здесь я хотел показать данные.данные я получаю форму c ++ через QtObject.Delegate.qml
import QtQuick 2.4
Component {id: множественный делегат
Rectangle
{
property QtObject model
property int delegateHeight: 224
height: delegateHeight
anchors.left: parent.left
anchors.leftMargin: 24
TextShadow
{
id: text
font.pixelSize: 24
height: 18
color: main.colors.white
anchors.left: parent.left
anchors.leftMargin: 24
anchors.top: parent.top
anchors.topMargin: 20
anchors.right: elapsedTime.left
anchors.rightMargin: 482
text: model.value
}
}
}