diff options
author | Sami Merila <sami.merila@nokia.com> | 2011-04-12 09:13:21 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2011-04-12 09:13:21 (GMT) |
commit | 8b9c94c95ef5dd9620dc35c4ab20cd109369636f (patch) | |
tree | 93b42e801293c6c61e1f0cf5ca56e622069b3c46 /src | |
parent | 7e032238ef7a91f4a9c1337b5e06204fadbc6f55 (diff) | |
download | Qt-8b9c94c95ef5dd9620dc35c4ab20cd109369636f.zip Qt-8b9c94c95ef5dd9620dc35c4ab20cd109369636f.tar.gz Qt-8b9c94c95ef5dd9620dc35c4ab20cd109369636f.tar.bz2 |
QS60Style: itemview item with checkbox and text is drawn incorrectly
QS60Style deduces incorrectly when itemview only contains checkbox.
This is minor, yet highly annoying bug that prevents highlighted
itemview item from showing its content with themes that have opaque
itemview item highlight (highlight covers the text that is underneath).
As a fix, check itemview item text and icon content before declaring
it as "checkbox only".
Task-number: QTBUG-18694
Reviewed-by: Tomi Vihria
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/styles/qs60style.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 91ac45e..f146075 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -3132,7 +3132,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con } break; case SE_ItemViewItemCheckIndicator: - if (const QStyleOptionViewItemV2 *vopt = qstyleoption_cast<const QStyleOptionViewItemV2 *>(opt)) { + if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(opt)) { const QAbstractItemView *listItem = qobject_cast<const QAbstractItemView *>(widget); const bool singleSelection = listItem && @@ -3140,7 +3140,7 @@ QRect QS60Style::subElementRect(SubElement element, const QStyleOption *opt, con listItem->selectionMode() == QAbstractItemView::NoSelection); const bool checkBoxOnly = (vopt->features & QStyleOptionViewItemV2::HasCheckIndicator) && listItem && - singleSelection; + singleSelection && vopt->text.isEmpty() && vopt->icon.isNull(); // Selection check mark rect. const int indicatorWidth = QS60StylePrivate::pixelMetric(PM_IndicatorWidth); |