Is there any list of the signals 开发者_如何学Cthat can be use with PyQT4 or at least there is one that is the opposite of lostFocus()?
There is a QFocusEvent
event generated by 'QWidget', but not a signal. There is however a convenient event handler that catches these events: focusInEvent
.
You can add your own signal by reimplementing this handler. For example (not tested):
class MyWidget(QtGui.QWidget):
focus_in = QtCore.pyqtSignal(int, name='focusIn')
def focusInEvent(self, event):
self.focus_in.emit()
QtGui.QWidget.focusInEvent(self, event)
Now you get a focusIn
signal.
精彩评论