Skip to content

Commit

Permalink
Fix a Qt error in loadUI that returned an error related to connectSlo…
Browse files Browse the repository at this point in the history
…tsByName. 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.
  • Loading branch information
astrofrog committed Aug 11, 2019
1 parent 7c3d471 commit cc61305
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion glue/viewers/profile/qt/profile_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,13 @@ def __init__(self, parent=None):

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

self._viewer = weakref.ref(parent)

self.ui = load_ui('profile_tools.ui', self,
directory=os.path.dirname(__file__))

fix_tab_widget_fontsize(self.ui.tabs)

self._viewer = weakref.ref(parent)
self.image_viewer = None

@property
Expand Down

0 comments on commit cc61305

Please sign in to comment.