summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStephen Kelly <stephen.kelly@kdab.com>2012-08-06 14:30:47 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-07 16:40:07 +0200
commitc5d7ea5badb4ccc0cd7027d8629d80809e7ec3d7 (patch)
tree1960b99e202a7e76a7298b18960c1c9201473a90 /src
parent2ade633c0a3f5614b0c640fbc050be3d7d925abb (diff)
Only emit the clicked() signal from views if the left button is used.
This is consistent with QAbstractButton, QCalendarWidget, QDialogButtonBox and QGroupBox (ie, all other widgets with a clicked signal) Task-number: QTBUG-26105 Change-Id: Ieafe988b5c03216796b69a7cd70ac1a03fc12b0a Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src')
-rw-r--r--src/widgets/itemviews/qabstractitemview.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/widgets/itemviews/qabstractitemview.cpp b/src/widgets/itemviews/qabstractitemview.cpp
index 40aa429260..929f7db406 100644
--- a/src/widgets/itemviews/qabstractitemview.cpp
+++ b/src/widgets/itemviews/qabstractitemview.cpp
@@ -522,7 +522,7 @@ void QAbstractItemViewPrivate::_q_scrollerStateChanged()
/*!
\fn void QAbstractItemView::clicked(const QModelIndex &index)
- This signal is emitted when a mouse button is clicked. The item
+ This signal is emitted when a mouse button is left-clicked. The item
the mouse was clicked on is specified by \a index. The signal is
only emitted when the index is valid.
@@ -1859,7 +1859,8 @@ void QAbstractItemView::mouseReleaseEvent(QMouseEvent *event)
setState(NoState);
if (click) {
- emit clicked(index);
+ if (event->button() == Qt::LeftButton)
+ emit clicked(index);
if (edited)
return;
QStyleOptionViewItemV4 option = d->viewOptionsV4();