diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-03-29 21:18:26 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2019-04-09 18:54:02 +0000 |
commit | 1029a2e01051cd35452941e7b49b36520481cdf0 (patch) | |
tree | a948b418eea71cea7a54f12d3d94947c16174510 /src | |
parent | 37c24c6b1b65c2ff9808e5c2e2a18cf496e4a9db (diff) |
QTableView: don't draw additional grid lines top and left
QTableView drew additional grid lines on the top and left side when
the corresponding header was not visible and the ScrollMode was
ScrollPerItem. After 8f2bacea41443af8564ff78f284016b6615a001b they were
also drawn for ScrolPerPixel for consistency. But they are not needed at
all and only create visual artifacts.
Therefore remove the drawing of the additional lines completely.
Fixes: QTBUG-74706
Change-Id: I5c77d53a2eeefab9b9bfe0efea6439f5afede4ac
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Andy Shaw <andy.shaw@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/itemviews/qtableview.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index e1280b250a..8fe5b70332 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -1573,29 +1573,6 @@ void QTableView::paintEvent(QPaintEvent *event) colp += columnWidth(col) - gridSize; painter.drawLine(colp, dirtyArea.top(), colp, dirtyArea.bottom()); } - - //draw the top & left grid lines if the headers are not visible. - //We do update this line when subsequent scroll happen (see scrollContentsBy) - if (horizontalHeader->isHidden() && top == 0) { - const int row = verticalHeader->logicalIndex(top); - if (!verticalHeader->isSectionHidden(row)) { - const int rowY = rowViewportPosition(row) + offset.y(); - if (rowY == dirtyArea.top()) - painter.drawLine(dirtyArea.left(), rowY, dirtyArea.right(), rowY); - } - } - if (verticalHeader->isHidden() && left == 0) { - const int col = horizontalHeader->logicalIndex(left); - if (!horizontalHeader->isSectionHidden(col)) { - int colX = columnViewportPosition(col) + offset.x(); - if (!isLeftToRight()) - colX += columnWidth(left) - 1; - if (isLeftToRight() && colX == dirtyArea.left()) - painter.drawLine(colX, dirtyArea.top(), colX, dirtyArea.bottom()); - if (!isLeftToRight() && colX == dirtyArea.right()) - painter.drawLine(colX, dirtyArea.top(), colX, dirtyArea.bottom()); - } - } painter.setPen(old); } } |