From c1b81190e2c705595a4df8a2a2d63da6f6aa95f3 Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 24 Apr 2017 21:52:51 +0200 Subject: Use hasFocus() to check if the QTreeView is considered active or not MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/widgets/itemviews/qtreeview.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/widgets/itemviews') 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) -- cgit v1.2.3