summaryrefslogtreecommitdiffstats
path: root/src/gui/itemviews/qabstractitemview.cpp
diff options
context:
space:
mode:
authorSami Merila <sami.merila@nokia.com>2010-05-14 11:38:31 (GMT)
committerSami Merila <sami.merila@nokia.com>2010-05-14 11:38:31 (GMT)
commit0749d35484a4efb2202a7c2b6da7d5b796ef5b56 (patch)
tree290396f132aece12c00da7d658954441bd525230 /src/gui/itemviews/qabstractitemview.cpp
parentaa3dc5ac75505285f7501eb75935414d309c077f (diff)
downloadQt-0749d35484a4efb2202a7c2b6da7d5b796ef5b56.zip
Qt-0749d35484a4efb2202a7c2b6da7d5b796ef5b56.tar.gz
Qt-0749d35484a4efb2202a7c2b6da7d5b796ef5b56.tar.bz2
QS60Style: In S60 3.x and 5.0 Qt itemviews behaviour is not nativelike
Currently style defines QStyle::SH_ItemView_ActivateItemOnSingleClick, which leads to itemview item activation only occur on double-click (or tap). The item selection work native-like on Sym^3. As a correction, style needs to check the passed styleoption and check whether or not the state "Selected" is on. In these cases, the itemactivation can proceed. Task-number: QTBUG-10697 Reviewed-by: Miikka Heikkinen
Diffstat (limited to 'src/gui/itemviews/qabstractitemview.cpp')
-rw-r--r--src/gui/itemviews/qabstractitemview.cpp5
1 files changed, 4 insertions, 1 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);
}
}