Example found here on docs website contains deprecated code and thus the following line should be removed:
header: Kirigami.ApplicationHeader {}
as it throws a warning:
qml: Warning: ApplicationHeader is deprecated, remove and use the automatic internal toolbar instead.