diff options
author | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-14 12:11:04 (GMT) |
---|---|---|
committer | Qt Continuous Integration System <qt-info@nokia.com> | 2010-05-14 12:11:04 (GMT) |
commit | b7c3a62c6da3b2ebfea82599d78777527674cc4f (patch) | |
tree | 309c776256cb99665fb5c0471a079db07e54501a /src | |
parent | 03eae990b1aea880ee863061e1429edc4a96c626 (diff) | |
parent | 0749d35484a4efb2202a7c2b6da7d5b796ef5b56 (diff) | |
download | Qt-b7c3a62c6da3b2ebfea82599d78777527674cc4f.zip Qt-b7c3a62c6da3b2ebfea82599d78777527674cc4f.tar.gz Qt-b7c3a62c6da3b2ebfea82599d78777527674cc4f.tar.bz2 |
Merge branch '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public into 4.6-integration
* '4.6' of scm.dev.nokia.troll.no:qt/qt-s60-public:
QS60Style: In S60 3.x and 5.0 Qt itemviews behaviour is not nativelike
Fix anomaly demo control strip icon placement
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/itemviews/qabstractitemview.cpp | 5 | ||||
-rw-r--r-- | src/gui/styles/qs60style.cpp | 10 |
2 files changed, 11 insertions, 4 deletions
diff --git a/src/gui/itemviews/qabstractitemview.cpp b/src/gui/itemviews/qabstractitemview.cpp index 2faf755..b464330 100644 --- a/src/gui/itemviews/qabstractitemview.cpp +++ b/src/gui/itemviews/qabstractitemview.cpp @@ -1785,7 +1785,10 @@ void QAbstractItemView::mouseReleaseEvent(QMouseEvent *event) emit clicked(index); if (edited) return; - if (style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, 0, this)) + QStyleOptionViewItemV4 option = d->viewOptionsV4(); + if (d->pressedAlreadySelected) + option.state |= QStyle::State_Selected; + if (style()->styleHint(QStyle::SH_ItemView_ActivateItemOnSingleClick, &option, this)) emit activated(index); } } diff --git a/src/gui/styles/qs60style.cpp b/src/gui/styles/qs60style.cpp index 924cabc..d28e1d9 100644 --- a/src/gui/styles/qs60style.cpp +++ b/src/gui/styles/qs60style.cpp @@ -2575,7 +2575,7 @@ QSize QS60Style::sizeFromContents(ContentsType ct, const QStyleOption *opt, int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *widget, QStyleHintReturn *hret) const { - int retValue = -1; + int retValue = 0; switch (sh) { case SH_RequestSoftwareInputPanel: if (QS60StylePrivate::isSingleClickUi()) @@ -2610,9 +2610,13 @@ int QS60Style::styleHint(StyleHint sh, const QStyleOption *opt, const QWidget *w case SH_Dial_BackgroundRole: retValue = QPalette::Base; break; - case SH_ItemView_ActivateItemOnSingleClick: - retValue = QS60StylePrivate::isSingleClickUi(); + case SH_ItemView_ActivateItemOnSingleClick: { + if (QS60StylePrivate::isSingleClickUi()) + retValue = true; + else if (opt && opt->state & QStyle::State_Selected) + retValue = true; break; + } case SH_ProgressDialog_TextLabelAlignment: retValue = (QApplication::layoutDirection() == Qt::LeftToRight) ? Qt::AlignLeft : |