diff options
author | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-01-13 13:54:31 +0100 |
---|---|---|
committer | Christian Ehrlicher <ch.ehrlicher@gmx.de> | 2018-01-17 19:08:11 +0000 |
commit | ef60435d2f5bc1f3962388a3b51941015893a4d0 (patch) | |
tree | 2b3ae4b62e36e8ef586c02a3e49ab7f3fb917930 /src/widgets/itemviews | |
parent | ec7e870e70bd83fbb22e5cf563fb7824f1a1fc44 (diff) |
QCommonStylePrivate::viewItemSize: fix text height calculation
QCommonStylePrivate::viewItemSize did not adjust the width when the item
had a decoration or a checkbox. This lead to a too big width used for
the layouting and therefore sometimes the calculated height was too
small.
Task-number: QTBUG-30116
Change-Id: I4468daa9820b9a8aa00fe959ab9b73fec23cc24e
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r-- | src/widgets/itemviews/qtableview.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qtableview.cpp b/src/widgets/itemviews/qtableview.cpp index 1e6a60a4d7..ec25ccdb12 100644 --- a/src/widgets/itemviews/qtableview.cpp +++ b/src/widgets/itemviews/qtableview.cpp @@ -971,6 +971,9 @@ int QTableViewPrivate::heightHintForIndex(const QModelIndex &index, int hint, QS option.rect.setHeight(height); option.rect.setX(q->columnViewportPosition(index.column())); option.rect.setWidth(q->columnWidth(index.column())); + // 1px less space when grid is shown (see drawCell) + if (showGrid) + option.rect.setWidth(option.rect.width() - 1); } hint = qMax(hint, q->itemDelegate(index)->sizeHint(option, index).height()); return hint; |