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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 26 Feb 2017 15:54:20 +0100
branch
maintenance
changeset 5565
8782cf2b1f6a
parent 5547
00e8452972f0
child 5566
e6c917c0cb97

Fix for a situation where a wrong object is sent to an appFocusChanged signal handler.
(grafted from 3e6e6d70c4ff7c67bc1c1b156108b6ba0fb3d27e)

E5Gui/E5SideBar.py file | annotate | diff | comparison | revisions
--- a/E5Gui/E5SideBar.py	Wed Feb 22 19:25:07 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