Skip to content

Commit

Permalink
QAIV::dataChanged(): Warn about invalid range
Browse files Browse the repository at this point in the history
Amends ff33981.
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 <giuseppe.dangelo@kdab.com>
  • Loading branch information
diseraluca-qt authored and chehrlic committed Oct 18, 2024
1 parent 436abff commit 4304bab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/widgets/itemviews/qabstractitemview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 4304bab

Please sign in to comment.