[neon/qt6/qt6-declarative/Neon/release] debian/patches: backport patch as per mailing list
Carlos De Maine
null at kde.org
Sun May 24 21:20:18 BST 2026
Git commit c2b9abae4e204f9ab6f05c5360bf6a2393a7c53e by Carlos De Maine.
Committed on 24/05/2026 at 19:39.
Pushed by carlosdem into branch 'Neon/release'.
backport patch as per mailing list
A +81 -0 debian/patches/8a2c82be6ad90e3f2a0760d8bab1e3a8cdb2473a.diff
A +1 -0 debian/patches/series
https://invent.kde.org/neon/qt6/qt6-declarative/-/commit/c2b9abae4e204f9ab6f05c5360bf6a2393a7c53e
diff --git a/debian/patches/8a2c82be6ad90e3f2a0760d8bab1e3a8cdb2473a.diff b/debian/patches/8a2c82be6ad90e3f2a0760d8bab1e3a8cdb2473a.diff
new file mode 100644
index 0000000..7f06355
--- /dev/null
+++ b/debian/patches/8a2c82be6ad90e3f2a0760d8bab1e3a8cdb2473a.diff
@@ -0,0 +1,81 @@
+diff --git a/src/qmlmodels/qqmltableinstancemodel.cpp b/src/qmlmodels/qqmltableinstancemodel.cpp
+index dc73a17b784a6493288004b8146b699f7b5cc71b..5bc35a119005b9faf2884ec7449b13f2b40cdad9 100644
+--- a/src/qmlmodels/qqmltableinstancemodel.cpp
++++ b/src/qmlmodels/qqmltableinstancemodel.cpp
+@@ -165,26 +165,21 @@ QObject *QQmlTableInstanceModel::object(int index, QQmlIncubator::IncubationMode
+ {
+ Q_ASSERT(m_delegate);
+
+- QQmlDelegateModelItem *modelItem = resolveModelItem(index, QModelIndex());
+- if (!modelItem)
+- return nullptr;
+-
+- // 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());
++ 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);
++ }
+
+- const int flatIndex = m_adaptorModel.indexAt(modelIndex.row(), modelIndex.column());
+- QQmlDelegateModelItem *modelItem = resolveModelItem(flatIndex, modelIndex);
+- if (!modelItem)
+- return nullptr;
++ 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);
++ return nullptr;
+ }
+
+ QObject *QQmlTableInstanceModel::incubateModelItemIfNeeded(QQmlDelegateModelItem *modelItem, QQmlIncubator::IncubationMode incubationMode)
+diff --git a/src/qmlmodels/qqmltableinstancemodel_p.h b/src/qmlmodels/qqmltableinstancemodel_p.h
+index 23b6ef15972457f50e25e073df0a4490b7739b70..a890b16a43b2d36079ac01fcda1e50ae3ac6dafe 100644
+--- a/src/qmlmodels/qqmltableinstancemodel_p.h
++++ b/src/qmlmodels/qqmltableinstancemodel_p.h
+@@ -86,7 +86,6 @@ public:
+ const QAbstractItemModel *abstractItemModel() const override;
+
+ 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);
+ void commitReleasedItems();
+diff --git a/src/quick/items/qquicktableview.cpp b/src/quick/items/qquicktableview.cpp
+index fa73aab9fca26744cff2dde8946c348c294d20a1..962403aec5c598f1c933f602e4a31b33fa0320ff 100644
+--- a/src/quick/items/qquicktableview.cpp
++++ b/src/quick/items/qquicktableview.cpp
+@@ -2826,19 +2826,11 @@ FxTableItem *QQuickTableViewPrivate::createFxTableItem(const QPoint &cell, QQmlI
+ Q_Q(QQuickTableView);
+
+ 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) {
+ if (model->incubationStatus(modelIndex) == QQmlIncubator::Loading) {
diff --git a/debian/patches/series b/debian/patches/series
new file mode 100644
index 0000000..190739c
--- /dev/null
+++ b/debian/patches/series
@@ -0,0 +1 @@
+8a2c82be6ad90e3f2a0760d8bab1e3a8cdb2473a.diff
More information about the Neon-commits
mailing list