From 15a1ae90f5b6da3ffd50acda63ddd33ca14227f4 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Sun, 15 Dec 2024 12:51:06 +0100 Subject: [PATCH] QAbstractItemView: use 'int' as datatype for updateThreshold ... to sync it with the rest of the api. This amends ff339819925ab550c48b53d9baaba43e5adebfaa. Pick-to: 6.9 Task-number: QTBUG-124173 Change-Id: I0ed4681bf7d3717f84a7e888affb0c8cae877c35 Reviewed-by: Volker Hilsheimer --- src/widgets/itemviews/qabstractitemview.cpp | 8 ++++---- src/widgets/itemviews/qabstractitemview.h | 7 +++---- src/widgets/itemviews/qabstractitemview_p.h | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp index 4f02abd1dce..798d9bc3716 100644 --- a/src/widgets/itemviews/qabstractitemview.cpp +++ b/src/widgets/itemviews/qabstractitemview.cpp @@ -3226,13 +3226,13 @@ int QAbstractItemView::sizeHintForColumn(int column) const \sa dataChanged() */ -uint32_t QAbstractItemView::updateThreshold() const +int QAbstractItemView::updateThreshold() const { Q_D(const QAbstractItemView); return d->updateThreshold; } -void QAbstractItemView::setUpdateThreshold(uint32_t threshold) +void QAbstractItemView::setUpdateThreshold(int threshold) { Q_D(QAbstractItemView); if (d->updateThreshold == threshold) @@ -3439,8 +3439,8 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde << "\n topleft: " << topLeft << "\n bottomRight:" << bottomRight; d->viewport->update(); - } else if ((bottomRight.row() - topLeft.row() + 1ULL) * - (bottomRight.column() - topLeft.column() + 1ULL) > d->updateThreshold) { + } else if ((bottomRight.row() - topLeft.row() + 1LL) * + (bottomRight.column() - topLeft.column() + 1LL) > d->updateThreshold) { // too many indices to check - force full update d->viewport->update(); } else { diff --git a/src/widgets/itemviews/qabstractitemview.h b/src/widgets/itemviews/qabstractitemview.h index db95b713a7c..287ca4be77a 100644 --- a/src/widgets/itemviews/qabstractitemview.h +++ b/src/widgets/itemviews/qabstractitemview.h @@ -46,8 +46,7 @@ class Q_WIDGETS_EXPORT QAbstractItemView : public QAbstractScrollArea RESET resetVerticalScrollMode) Q_PROPERTY(ScrollMode horizontalScrollMode READ horizontalScrollMode WRITE setHorizontalScrollMode RESET resetHorizontalScrollMode) - Q_PROPERTY(uint32_t updateThreshold READ updateThreshold - WRITE setUpdateThreshold) + Q_PROPERTY(int updateThreshold READ updateThreshold WRITE setUpdateThreshold) public: enum SelectionMode { @@ -179,8 +178,8 @@ class Q_WIDGETS_EXPORT QAbstractItemView : public QAbstractScrollArea virtual int sizeHintForRow(int row) const; virtual int sizeHintForColumn(int column) const; - uint32_t updateThreshold() const; - void setUpdateThreshold(uint32_t threshold); + int updateThreshold() const; + void setUpdateThreshold(int threshold); void openPersistentEditor(const QModelIndex &index); void closePersistentEditor(const QModelIndex &index); diff --git a/src/widgets/itemviews/qabstractitemview_p.h b/src/widgets/itemviews/qabstractitemview_p.h index 292ba095098..1a1a66682ac 100644 --- a/src/widgets/itemviews/qabstractitemview_p.h +++ b/src/widgets/itemviews/qabstractitemview_p.h @@ -422,7 +422,7 @@ class Q_AUTOTEST_EXPORT QAbstractItemViewPrivate : public QAbstractScrollAreaPri bool verticalScrollModeSet; bool horizontalScrollModeSet; - uint32_t updateThreshold; + int updateThreshold; virtual QRect visualRect(const QModelIndex &index) const { return q_func()->visualRect(index); }