summaryrefslogtreecommitdiffstats
path: root/src/widgets/itemviews/qtableview.cpp
diff options
context:
space:
mode:
authorChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-01-07 21:34:31 +0100
committerChristian Ehrlicher <ch.ehrlicher@gmx.de>2018-01-09 17:54:22 +0000
commita40e2c7d98a5695574bbe5babad904f64cf28efa (patch)
treecd288c4f0da2e0061eeaa37909c0090397fd4be6 /src/widgets/itemviews/qtableview.cpp
parentb3e4be2d8b9debf217657436139da0152f6f8797 (diff)
Avoid useless casts to/from uint
Remove some c-style casts from int to uint which were needed in Qt3 (or earlier?) but nowadays the values are all int. Change-Id: Iecd739c450873adf952a17f635d7fb6825537907 Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/widgets/itemviews/qtableview.cpp')
-rw-r--r--src/widgets/itemviews/qtableview.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp
index 3b0a738d38..1e6a60a4d7 100644
--- a/src/widgets/itemviews/qtableview.cpp
+++ b/src/widgets/itemviews/qtableview.cpp
@@ -1362,8 +1362,8 @@ void QTableView::paintEvent(QPaintEvent *event)
if (horizontalHeader->count() == 0 || verticalHeader->count() == 0 || !d->itemDelegate)
return;
- uint x = horizontalHeader->length() - horizontalHeader->offset() - (rightToLeft ? 0 : 1);
- uint y = verticalHeader->length() - verticalHeader->offset() - 1;
+ const int x = horizontalHeader->length() - horizontalHeader->offset() - (rightToLeft ? 0 : 1);
+ const int y = verticalHeader->length() - verticalHeader->offset() - 1;
//firstVisualRow is the visual index of the first visible row. lastVisualRow is the visual index of the last visible Row.
//same goes for ...VisualColumn
@@ -1415,10 +1415,10 @@ void QTableView::paintEvent(QPaintEvent *event)
int top = 0;
bool alternateBase = false;
if (alternate && verticalHeader->sectionsHidden()) {
- uint verticalOffset = verticalHeader->offset();
+ const int verticalOffset = verticalHeader->offset();
int row = verticalHeader->logicalIndex(top);
for (int y = 0;
- ((uint)(y += verticalHeader->sectionSize(top)) <= verticalOffset) && (top < bottom);
+ ((y += verticalHeader->sectionSize(top)) <= verticalOffset) && (top < bottom);
++top) {
row = verticalHeader->logicalIndex(top);
if (alternate && !verticalHeader->isSectionHidden(row))
@@ -2131,9 +2131,9 @@ void QTableView::updateGeometries()
// ### move this block into the if
QSize vsize = d->viewport->size();
QSize max = maximumViewportSize();
- uint horizontalLength = d->horizontalHeader->length();
- uint verticalLength = d->verticalHeader->length();
- if ((uint)max.width() >= horizontalLength && (uint)max.height() >= verticalLength)
+ const int horizontalLength = d->horizontalHeader->length();
+ const int verticalLength = d->verticalHeader->length();
+ if (max.width() >= horizontalLength && max.height() >= verticalLength)
vsize = max;
// horizontal scroll bar