diff options
author | Andy Shaw <andy.shaw@qt.io> | 2019-11-25 21:30:25 +0100 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2019-11-29 06:53:10 +0000 |
commit | 985f4910249a0308b746695e64aa1a6205492421 (patch) | |
tree | f8ba3250daf534d813b80c9d774bbce1a72d808f /src/widgets/itemviews | |
parent | 67bbe28d67c99d99e752cd6054c9b576c7702358 (diff) |
QTreeView: Reset the pressed index if the decoration was pressed on
We need to reset the pressed index when the decoration was pressed on
otherwise if the mouse ends up over an already selected item that was
previously clicked on. This prevents it from thinking that the mouse
has been released on this item right after pressing on it.
Fixes: QTBUG-59067
Change-Id: Iab372ae20db3682ab0812661f86533079ba4083c
Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
Diffstat (limited to 'src/widgets/itemviews')
-rw-r--r-- | src/widgets/itemviews/qtreeview.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 034c1f4b4f..442369c2ec 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1892,6 +1892,8 @@ void QTreeView::mousePressEvent(QMouseEvent *event) handled = d->expandOrCollapseItemAtPos(event->pos()); if (!handled && d->itemDecorationAt(event->pos()) == -1) QAbstractItemView::mousePressEvent(event); + else + d->pressedIndex = QModelIndex(); } /*! |