qtutils: guard against unhashable widget types
commit5e2a24d1a9671a5729da5cb34c38d808565260a4
authorDavid Aguilar <davvid@gmail.com>
Sun, 11 Jul 2021 18:30:41 +0000 (11 11:30 -0700)
committerDavid Aguilar <davvid@gmail.com>
Sun, 11 Jul 2021 22:25:09 +0000 (11 15:25 -0700)
treeac916fa5ec5df2f3aee451e678603ee3688c57ae
parenta6398918c61c071eb89b37c9ac1582d3f92825f3
qtutils: guard against unhashable widget types

There was a short-lived bug in an earlier version of PyQt5 that
made widgets unhashable. Even though this bug was an oversight
and was quickly patched, it did temporarily break the ability to
use widgets as dict keys.

While this is not an issue in practice we can still make the
BlockSignals class robust to unhashable widgets.

Use id(widget) as the dict key rather using the widget as the
key directly.

Signed-off-by: David Aguilar <davvid@gmail.com>
cola/qtutils.py