Keen Learner
Keen Learner

Reputation: 195

QML Listview in QMLProfiler reporting twice delegate creation

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
            }
        }
    }
}

enter image description here

Upvotes: 0

Views: 179

Answers (1)

talamaki
talamaki

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

Related Questions