Log when the focus object changed.

This is mainly needed for tests to synchronize things properly.
This commit is contained in:
Florian Bruhin 2015-11-24 15:23:50 +01:00
parent 14f4689998
commit 75178b0cdc

View File

@ -746,6 +746,12 @@ class Application(QApplication):
objreg.register('app', self)
self.launch_time = datetime.datetime.now()
self.focusObjectChanged.connect(self.on_focus_object_changed)
@pyqtSlot(QObject)
def on_focus_object_changed(self, obj):
"""Log when the focus object changed."""
log.misc.debug("Focus object changed: {!r}".format(obj))
def __repr__(self):
return utils.get_repr(self)