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 <alessandro.portale@qt.io>
bb10
Friedemann Kleint 2016-04-13 15:03:23 +02:00
parent 58e1465cb0
commit 4499667799
1 changed files with 2 additions and 0 deletions

View File

@ -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