Skip to content

Commit 09e8d28

Browse files
committed
Fix a Qt error in loadUI that returned an error related to connectSlotsByName. The error happens following the change in python/cpython#13589. Basically it looks like connectSlotsByName causes all properties of the Qt class to be accessed, but the viewer property didn't previously work before the load_ui call since _viewer wasn't defined and an AttributeError was raised. The fix here is to make sure that self._viewer is defined before load_ui is called.
1 parent ba7d59c commit 09e8d28

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

glue/viewers/profile/qt/profile_tools.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,13 @@ def __init__(self, parent=None):
7272

7373
super(ProfileTools, self).__init__(parent=parent)
7474

75+
self._viewer = weakref.ref(parent)
76+
7577
self.ui = load_ui('profile_tools.ui', self,
7678
directory=os.path.dirname(__file__))
7779

7880
fix_tab_widget_fontsize(self.ui.tabs)
7981

80-
self._viewer = weakref.ref(parent)
8182
self.image_viewer = None
8283

8384
@property

0 commit comments

Comments
 (0)