Skip to content

Commit

Permalink
QAbstractItemView: use 'int' as datatype for updateThreshold
Browse files Browse the repository at this point in the history
... to sync it with the rest of the api.
This amends ff33981.

Pick-to: 6.9
Task-number: QTBUG-124173
Change-Id: I0ed4681bf7d3717f84a7e888affb0c8cae877c35
Reviewed-by: Volker Hilsheimer <[email protected]>
  • Loading branch information
chehrlic committed Dec 16, 2024
1 parent af760da commit 15a1ae9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/widgets/itemviews/qabstractitemview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 {
Expand Down
7 changes: 3 additions & 4 deletions src/widgets/itemviews/qabstractitemview.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/widgets/itemviews/qabstractitemview_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); }

Expand Down

0 comments on commit 15a1ae9

Please sign in to comment.