Reputation: 195
Here is an simple ListView with just 10 items. When i ran QMLProfiler for this application, the stats Shows that the number of calls made to create the delegate are twice. Could someone explain is this behavior?
import QtQuick 2.12
import QtQuick.Window 2.12
Window {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
ListView{
anchors.fill: parent
model: 10
delegate: Rectangle{
width: parent.width
height: 60
Text {
id: name
text: qsTr("Item is ") + index
}
}
}
}
Upvotes: 0
Views: 179
Reputation: 5472
The answer can be found from the Qt bug report QML Profiler shows double amount of Repeater delegate Create calls which tells the following:
Object creation typically happens in two stages, which are counted separately in the profiler.
Each object creation involves one creation phase and one callback to componentComplete(). Those are tracked separately.
Upvotes: 1