summaryrefslogtreecommitdiffstats
path: root/src/gui/styles
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-03-22 06:56:44 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-03-22 06:56:44 (GMT)
commit019f5999dd5159268f55abdf56310795bfde3375 (patch)
treed7b97b9f153fef262d1d7803e5b33ebb20a4d88e /src/gui/styles
parent48f1ff3315f6d3fc05901ba6a83e02a79d9148fc (diff)
downloadQt-019f5999dd5159268f55abdf56310795bfde3375.zip
Qt-019f5999dd5159268f55abdf56310795bfde3375.tar.gz
Qt-019f5999dd5159268f55abdf56310795bfde3375.tar.bz2
QS60Style: All itemviews should indicate selection with tick mark
In QS60Style, all itemviews should indicate selection/multiselection with tick mark. Unfortunately it now uses object casting to QListView currently to check the viability of widget to have tick mark. Thus, it fails for QTreeViews and QTableViews. Changing object casting to QAbstractItemView to support all item views. Task-number: QTBUG-9212 Reviewed-by: Alessandro Portale
Diffstat (limited to 'src/gui/styles')
-rw-r--r--src/gui/styles/qs60style.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp
index cd556b8..750e19f 100644
--- a/src/gui/styles/qs60style.cpp
+++ b/src/gui/styles/qs60style.cpp
@@ -2069,11 +2069,11 @@ void QS60Style::drawPrimitive(PrimitiveElement element, const QStyleOption *opti
break;
case PE_IndicatorViewItemCheck:
#ifndef QT_NO_ITEMVIEWS
- if (const QListView *listItem = (qobject_cast<const QListView *>(widget))) {
+ if (const QAbstractItemView *itemView = (qobject_cast<const QAbstractItemView *>(widget))) {
if (const QStyleOptionViewItemV4 *vopt = qstyleoption_cast<const QStyleOptionViewItemV4 *>(option)) {
const bool checkBoxVisible = vopt->features & QStyleOptionViewItemV2::HasCheckIndicator;
- const bool singleSelection = listItem->selectionMode() ==
- QAbstractItemView::SingleSelection || listItem->selectionMode() == QAbstractItemView::NoSelection;
+ const bool singleSelection = itemView->selectionMode() ==
+ QAbstractItemView::SingleSelection || itemView->selectionMode() == QAbstractItemView::NoSelection;
// draw either checkbox at the beginning
if (checkBoxVisible && singleSelection) {
drawPrimitive(PE_IndicatorCheckBox, option, painter, widget);