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 <volker.hilsheimer@qt.io>
This commit is contained in:
Christian Ehrlicher 2024-12-15 12:51:06 +01:00
parent af760da541
commit 15a1ae90f5
3 changed files with 8 additions and 9 deletions

View File

@ -3226,13 +3226,13 @@ int QAbstractItemView::sizeHintForColumn(int column) const
\sa dataChanged() \sa dataChanged()
*/ */
uint32_t QAbstractItemView::updateThreshold() const int QAbstractItemView::updateThreshold() const
{ {
Q_D(const QAbstractItemView); Q_D(const QAbstractItemView);
return d->updateThreshold; return d->updateThreshold;
} }
void QAbstractItemView::setUpdateThreshold(uint32_t threshold) void QAbstractItemView::setUpdateThreshold(int threshold)
{ {
Q_D(QAbstractItemView); Q_D(QAbstractItemView);
if (d->updateThreshold == threshold) if (d->updateThreshold == threshold)
@ -3439,8 +3439,8 @@ void QAbstractItemView::dataChanged(const QModelIndex &topLeft, const QModelInde
<< "\n topleft: " << topLeft << "\n topleft: " << topLeft
<< "\n bottomRight:" << bottomRight; << "\n bottomRight:" << bottomRight;
d->viewport->update(); d->viewport->update();
} else if ((bottomRight.row() - topLeft.row() + 1ULL) * } else if ((bottomRight.row() - topLeft.row() + 1LL) *
(bottomRight.column() - topLeft.column() + 1ULL) > d->updateThreshold) { (bottomRight.column() - topLeft.column() + 1LL) > d->updateThreshold) {
// too many indices to check - force full update // too many indices to check - force full update
d->viewport->update(); d->viewport->update();
} else { } else {

View File

@ -46,8 +46,7 @@ class Q_WIDGETS_EXPORT QAbstractItemView : public QAbstractScrollArea
RESET resetVerticalScrollMode) RESET resetVerticalScrollMode)
Q_PROPERTY(ScrollMode horizontalScrollMode READ horizontalScrollMode Q_PROPERTY(ScrollMode horizontalScrollMode READ horizontalScrollMode
WRITE setHorizontalScrollMode RESET resetHorizontalScrollMode) WRITE setHorizontalScrollMode RESET resetHorizontalScrollMode)
Q_PROPERTY(uint32_t updateThreshold READ updateThreshold Q_PROPERTY(int updateThreshold READ updateThreshold WRITE setUpdateThreshold)
WRITE setUpdateThreshold)
public: public:
enum SelectionMode { enum SelectionMode {
@ -179,8 +178,8 @@ public:
virtual int sizeHintForRow(int row) const; virtual int sizeHintForRow(int row) const;
virtual int sizeHintForColumn(int column) const; virtual int sizeHintForColumn(int column) const;
uint32_t updateThreshold() const; int updateThreshold() const;
void setUpdateThreshold(uint32_t threshold); void setUpdateThreshold(int threshold);
void openPersistentEditor(const QModelIndex &index); void openPersistentEditor(const QModelIndex &index);
void closePersistentEditor(const QModelIndex &index); void closePersistentEditor(const QModelIndex &index);

View File

@ -422,7 +422,7 @@ public:
bool verticalScrollModeSet; bool verticalScrollModeSet;
bool horizontalScrollModeSet; bool horizontalScrollModeSet;
uint32_t updateThreshold; int updateThreshold;
virtual QRect visualRect(const QModelIndex &index) const { return q_func()->visualRect(index); } virtual QRect visualRect(const QModelIndex &index) const { return q_func()->visualRect(index); }