Repository navigation
Remove old-style signals and slots - #256
Conversation
|
A second set of eyes on this would be useful just to check for dumb typos. @mdickinson do you have time to double check this? |
Current coverage is 46.49% (diff: 27.27%)@@ master #256 diff @@
==========================================
Files 283 283
Lines 19090 19090
Methods 0 0
Messages 0 0
Branches 3064 3064
==========================================
Hits 8875 8875
Misses 9829 9829
Partials 386 386
|
| QtCore.QObject.connect(QtGui.QApplication.instance(), | ||
| QtCore.SIGNAL('focusChanged(QWidget *,QWidget *)'), | ||
| self._focus_changed) | ||
| QtGui.QApplication.instance().focusChanged.connect(self._focus_changed) |
There was a problem hiding this comment.
Is there any reason to worry about the return value of instance() being None here? (Just wondering whether QtCore.QObject.connect automatically ignores Nones.)
There was a problem hiding this comment.
I don't know if it handles None values gracefully, but I think things would have to be going very wrong for there to be no QApplication at the point where the __init__ is being called.
From the point of view of testing, we should probably be a little worried about this signal handler potentially hanging around across test boundaries.
| else: | ||
| nw = ntw.widget(ntidx) | ||
|
|
||
| self.emit(QtCore.SIGNAL('hasFocus'), nw) |
There was a problem hiding this comment.
Probably off-topic for this PR, but why SIGNAL('hasFocus') rather than SIGNAL('hasFocus()')? This seems inconsistent with the other uses of SIGNAL.
There was a problem hiding this comment.
Probably off-topic for this PR
... though it might be worth checking that there's no behaviour change here, if there's any reasonable way to do so.
There was a problem hiding this comment.
Probably because that's what PyQt expected back in the day. Or it could have been a bug.
There was a problem hiding this comment.
And no, there shouldn't be any behavior change.
| self._qt4_editor_title_changed) | ||
| editor_area.focusChanged.connect(self._qt4_view_focus_changed) | ||
|
|
||
| editor_area.tabTextChanged.connect(self._qt4_editor_title_changed) |
There was a problem hiding this comment.
Should the object be self._qt4_editor_area rather than editor_area here?
There was a problem hiding this comment.
Ah, sorry; they're the same. So, no.
|
LGTM |
This is a fairly mechanical change. The hope is that this will help resolve #245, since old-style signals and slots has been implicated in some of the problems.