Note that this is a non-official backport which required a bit of adaptation to work with 6.10.3, seems to work but possible overlooked something. https://bugs.gentoo.org/973374 https://codereview.qt-project.org/c/qt%2Fqtdeclarative/+/733089 --- a/src/qml/qml/qqmltypecompiler.cpp +++ b/src/qml/qml/qqmltypecompiler.cpp @@ -5,4 +5,5 @@ #include "qqmltypecompiler_p.h" +#include #include #include @@ -919,13 +920,12 @@ // Apply the ordering in the IR obj->setFirstAlias(ordered[0]); - if (ordered[0] == defaultPropertyAlias) - obj->indexOfDefaultPropertyOrAlias = 0; - for (qsizetype i = 0, end = ordered.size() - 1; i < end; ++i) { + for (qsizetype i = 0, end = ordered.size() - 1; i < end; ++i) ordered[i]->next = ordered[i + 1]; - if (ordered[i] == defaultPropertyAlias) - obj->indexOfDefaultPropertyOrAlias = i; - } ordered.last()->next = nullptr; + if (defaultPropertyAlias) { + auto it = std::find(ordered.constBegin(), ordered.constEnd(), defaultPropertyAlias); + obj->indexOfDefaultPropertyOrAlias = std::distance(ordered.constBegin(), it); + } return true; }