Fix for a situation where a wrong object is sent to an appFocusChanged signal handler.

Sun, 26 Feb 2017 15:54:20 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 26 Feb 2017 15:54:20 +0100
changeset 5563
3e6e6d70c4ff
parent 5562
19f22f304e2c
child 5564
d670b282b5b5

Fix for a situation where a wrong object is sent to an appFocusChanged signal handler.

E5Gui/E5SideBar.py file | annotate | diff | comparison | revisions
diff -r 19f22f304e2c -r 3e6e6d70c4ff E5Gui/E5SideBar.py
--- a/E5Gui/E5SideBar.py	Sun Feb 26 15:16:35 2017 +0100
+++ b/E5Gui/E5SideBar.py	Sun Feb 26 15:54:20 2017 +0100
@@ -653,11 +653,13 @@
         @param old reference to the widget, that lost focus (QWidget or None)
         @param now reference to the widget having the focus (QWidget or None)
         """
-        self.__hasFocus = self.isAncestorOf(now)
-        if self.__autoHide and not self.__hasFocus and not self.isMinimized():
-            self.shrink()
-        elif self.__autoHide and self.__hasFocus and self.isMinimized():
-            self.expand()
+        if isinstance(now, QWidget):
+            self.__hasFocus = self.isAncestorOf(now)
+            if self.__autoHide and not self.__hasFocus and \
+                    not self.isMinimized():
+                self.shrink()
+            elif self.__autoHide and self.__hasFocus and self.isMinimized():
+                self.expand()
     
     def enterEvent(self, event):
         """

eric ide

mercurial