Component is a special type in the QtQml module that acts as a blueprint for creating objects in QML. Every QML object is implicitly part of a Component, even if you don't explicitly wrap it in a Component block. For example:
import QtQuick
Item {
Component.onCompleted: {
console.log("Hello World")
}
}
Internally, QML treats this as if it is wrapped in a Component:
import QtQuick
Component {
Item {
Component.onCompleted: {
console.log("Hello World")
}
}
}
You can analyze QQuickItem class and you will see that it inherits from QObject and QQmlParserStatus, hence it is possible to call Component.onCompleted() in Item objects.