Deactivating an inactive item should do (almost) nothing. 2706
authorAndreas Aardal Hanssen <andrhans@cisco.com>
Fri, 21 Oct 2011 08:12:57 +0000 (10:12 +0200)
committerAndreas Aardal Hanssen <andreas.hanssen@tandberg.com>
Fri, 21 Oct 2011 10:06:38 +0000 (12:06 +0200)
commit8c6d1fb21a3e8776296a55be77ef564049212357
tree59f28ea62e1fd7f6374c67c3da60206ce9b71d55
parent07e1f649716783d0097ee1db910990ea11bfb9a7
Deactivating an inactive item should do (almost) nothing.

The bug fixed by this task causes the last panel, which can be
any panel depending on the situation, to gain input focus when
an already-inactive item is deactivated by calling setActive(false).
This is obviously wrong.

It's also wrong that setActive(isActive()) is a noop when the
item is already inactive. It's essential that the explicit- and
wantsActive flags are set correctly, so that calling setActive(false)
on an item that's part of an inactive scene (f.ex.) hinders that
item in gaining automatic activation when the scene is activated.

Task-number: QTBUG-12966
Reviewed-by: James Perrett <jamperre@cisco.com>
src/gui/graphicsview/qgraphicsitem.cpp
src/gui/graphicsview/qgraphicsscene.cpp
tests/auto/qgraphicsitem/tst_qgraphicsitem.cpp