diff options
author | Sami Merila <sami.merila@nokia.com> | 2010-03-22 06:56:44 (GMT) |
---|---|---|
committer | Sami Merila <sami.merila@nokia.com> | 2010-03-22 06:56:44 (GMT) |
commit | 019f5999dd5159268f55abdf56310795bfde3375 (patch) | |
tree | d7b97b9f153fef262d1d7803e5b33ebb20a4d88e /src/gui/styles | |
parent | 48f1ff3315f6d3fc05901ba6a83e02a79d9148fc (diff) | |
download | Qt-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.cpp | 6 |
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); |