From 4499667799aba463b3059b9b20a31afde65a5c9a Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Wed, 13 Apr 2016 15:03:23 +0200 Subject: [PATCH] QCommonStyle::sizeFromContents(): Increase height of CT_ItemViewItem Prevent icons from overlapping by adding a small margin (as does QWindowsVistaStyle) should the total height equal the icon size. Task-number: QTBUG-52353 Change-Id: Iad0b7374a22129ee92ff3cc4479118c10db377aa Reviewed-by: Alessandro Portale --- src/widgets/styles/qcommonstyle.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/widgets/styles/qcommonstyle.cpp b/src/widgets/styles/qcommonstyle.cpp index 690c811140..b75088ae50 100644 --- a/src/widgets/styles/qcommonstyle.cpp +++ b/src/widgets/styles/qcommonstyle.cpp @@ -4872,6 +4872,8 @@ QSize QCommonStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, QRect decorationRect, displayRect, checkRect; d->viewItemLayout(vopt, &checkRect, &decorationRect, &displayRect, true); sz = (decorationRect|displayRect|checkRect).size(); + if (decorationRect.isValid() && sz.height() == decorationRect.height()) + sz.rheight() += 2; // Prevent icons from overlapping. } break; #endif // QT_NO_ITEMVIEWS