diff --git a/dev-qt/qtdeclarative/files/qtdeclarative-6.11.1-QTBUG-146869.patch b/dev-qt/qtdeclarative/files/qtdeclarative-6.11.1-QTBUG-146869.patch new file mode 100644 index 0000000000000..695d66c6b82dd --- /dev/null +++ b/dev-qt/qtdeclarative/files/qtdeclarative-6.11.1-QTBUG-146869.patch @@ -0,0 +1,73 @@ +https://mail.kde.org/pipermail/distributions/2026-May/001692.html +https://bugs.kde.org/show_bug.cgi?id=520252 +https://qt-project.atlassian.net/browse/QTBUG-146869 +--- a/src/qmlmodels/qqmltableinstancemodel.cpp ++++ b/src/qmlmodels/qqmltableinstancemodel.cpp +@@ -166,24 +166,19 @@ + Q_ASSERT(m_delegate); + +- QQmlDelegateModelItem *modelItem = resolveModelItem(index, QModelIndex()); +- if (!modelItem) +- return nullptr; ++ QModelIndex modelIndex; ++ if (const QAbstractItemModel *aim = abstractItemModel()) { ++ // A valid QModelIndex is needed for resolveModelItem() to match ++ // items in the release cache rather than just delegate type alone. ++ const int row = m_adaptorModel.rowAt(index); ++ const int column = m_adaptorModel.columnAt(index); ++ modelIndex = aim->index(row, column); ++ } ++ ++ if (QQmlDelegateModelItem *modelItem = resolveModelItem(index, modelIndex)) { ++ // Return the incubated object, or start an async incubation task and return nullptr for now ++ return incubateModelItemIfNeeded(modelItem, incubationMode); ++ } + +- // Return the incubated object, or start an async incubation task and return nullptr for now +- return incubateModelItemIfNeeded(modelItem, incubationMode); +-} +- +-QObject *QQmlTableInstanceModel::object(const QModelIndex &modelIndex, QQmlIncubator::IncubationMode incubationMode) +-{ +- Q_ASSERT(m_delegate); +- Q_ASSERT(m_adaptorModel.adaptsAim()); +- +- const int flatIndex = m_adaptorModel.indexAt(modelIndex.row(), modelIndex.column()); +- QQmlDelegateModelItem *modelItem = resolveModelItem(flatIndex, modelIndex); +- if (!modelItem) +- return nullptr; +- +- // Return the incubated object, or start an async incubation task and return nullptr for now +- return incubateModelItemIfNeeded(modelItem, incubationMode); ++ return nullptr; + } + +--- a/src/qmlmodels/qqmltableinstancemodel_p.h ++++ b/src/qmlmodels/qqmltableinstancemodel_p.h +@@ -87,5 +87,4 @@ + + QObject *object(int index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested) override; +- QObject *object(const QModelIndex &index, QQmlIncubator::IncubationMode incubationMode = QQmlIncubator::AsynchronousIfNested); + QObject *incubateModelItemIfNeeded(QQmlDelegateModelItem *modelItem, QQmlIncubator::IncubationMode incubationMode); + void restoreFromReleasedItemsCache(QQmlDelegateModelItem *item, int newFlatIndex); +--- a/src/quick/items/qquicktableview.cpp ++++ b/src/quick/items/qquicktableview.cpp +@@ -2827,17 +2827,9 @@ + + bool ownItem = false; +- QObject* object = nullptr; +- const QAbstractItemModel *aim = model->abstractItemModel(); + const int modelRow = isTransposed ? logicalColumnIndex(cell.y()) : logicalRowIndex(cell.y()); + const int modelColumn = isTransposed ? logicalRowIndex(cell.x()) : logicalColumnIndex(cell.x()); + const int modelIndex = modelIndexAtCell(QPoint(modelColumn, modelRow)); + +- if (tableModel && aim) { +- // Prefer loading via QModelIndex so that QQmlTableInstanceModel can also +- // match recently released items by model index, not just by delegate type. +- object = tableModel->object(aim->index(modelRow, modelColumn), incubationMode); +- } else { +- object = model->object(modelIndex, incubationMode); +- } ++ QObject *object = model->object(modelIndex, incubationMode); + + if (!object) { diff --git a/dev-qt/qtdeclarative/qtdeclarative-6.11.1.ebuild b/dev-qt/qtdeclarative/qtdeclarative-6.11.1-r1.ebuild similarity index 96% rename from dev-qt/qtdeclarative/qtdeclarative-6.11.1.ebuild rename to dev-qt/qtdeclarative/qtdeclarative-6.11.1-r1.ebuild index 40fff605ebe2e..715f42393666b 100644 --- a/dev-qt/qtdeclarative/qtdeclarative-6.11.1.ebuild +++ b/dev-qt/qtdeclarative/qtdeclarative-6.11.1-r1.ebuild @@ -32,6 +32,10 @@ BDEPEND=" ~dev-qt/qtshadertools-${PV}:6 " +PATCHES=( + "${FILESDIR}"/${PN}-6.11.1-QTBUG-146869.patch +) + src_configure() { local mycmakeargs=( $(cmake_use_find_package qmlls Qt6LanguageServerPrivate)