开发者

PyQT QtCore.SIGNAL

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜