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>
bb10
Andy Shaw 2017-04-24 21:52:51 +02:00
parent b2d8e1e5be
commit c1b81190e2
1 changed files with 1 additions and 1 deletions

View File

@ -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)