From 4304bab5daf2b5426ea57aeb4b2734317cc6ba94 Mon Sep 17 00:00:00 2001 From: Luca Di Sera Date: Fri, 11 Oct 2024 15:17:11 +0200 Subject: [PATCH] QAIV::dataChanged(): Warn about invalid range Amends ff339819925ab550c48b53d9baaba43e5adebfaa. Invalid range arguments were asserted in QAIV::dataChanged() without a proper hint what was wrong. Replace it by a qWarning() with a more verbose output. Task-number: QTBUG-124173 Change-Id: Ib15fbb37947fd322afe65af9aed0daacb18330e5 Reviewed-by: Giuseppe D'Angelo --- src/widgets/itemviews/qabstractitemview.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 12d0d952de4..4f02abd1dce 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -3435,7 +3435,9 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde topLeft.row() > bottomRight.row() || topLeft.column() > bottomRight.column()) { // invalid parameter - call update() to redraw all - Q_ASSERT(false); + qWarning().nospace() << "dataChanged() called with an invalid index range:" + << "\n topleft: " << topLeft + << "\n bottomRight:" << bottomRight; d->viewport->update(); } else if ((bottomRight.row() - topLeft.row() + 1ULL) * (bottomRight.column() - topLeft.column() + 1ULL) > d->updateThreshold) {