diff options
author | Andy Shaw <andy.shaw@qt.io> | 2017-04-24 21:52:51 +0200 |
---|---|---|
committer | Andy Shaw <andy.shaw@qt.io> | 2017-05-23 14:00:30 +0000 |
commit | c1b81190e2c705595a4df8a2a2d63da6f6aa95f3 (patch) | |
tree | 04472c20e620806f112c988d272153e3571314a1 /src/widgets | |
parent | b2d8e1e5be8508a9a312c070ceb8c77b9497a705 (diff) |
Use hasFocus() to check if the QTreeView is considered active or not
When drawing the branches in a QTreeView, it should use hasFocus() to
determine if it is the active widget or not. This is how it checks when
styling the other aspects of the treeview, so the branches should be
done in line with this.
Change-Id: Id721401424ad95e9fc7ffbdc991e53b5f7feac01
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/itemviews/qtreeview.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/itemviews/qtreeview.cpp b/src/widgets/itemviews/qtreeview.cpp index 9583dd9657..f139fb2d5b 100644 --- a/src/widgets/itemviews/qtreeview.cpp +++ b/src/widgets/itemviews/qtreeview.cpp @@ -1818,7 +1818,7 @@ void QTreeView::drawBranches(QPainter *painter, const QRect &rect, QStyle::State extraFlags = QStyle::State_None; if (isEnabled()) extraFlags |= QStyle::State_Enabled; - if (window()->isActiveWindow()) + if (hasFocus()) extraFlags |= QStyle::State_Active; QPoint oldBO = painter->brushOrigin(); if (verticalScrollMode() == QAbstractItemView::ScrollPerPixel) |