[PyQt] Pyqt 5.7.1 no signature compatible with focusChanged

oliver oliver.schoenborn at gmail.com
Fri Aug 26 22:39:55 BST 2016


import sys
from PyQt5.QtWidgets import QWidget, QApplication
from PyQt5.QtCore import QObject, pyqtSlot

class Test(QObject):
@pyqtSlot(QWidget, QWidget)
def test(self, previous_widget: QWidget, current_widget: QWidget):
pass

if __name__ == '__main__':
app = QApplication(sys.argv)
test = Test()
app.focusChanged.connect(test.test)
sys.exit(app.exec_())

Which raises a couple other questions:
- does it matter of we don't use pyqtSlot decorator (if not,  why not?)
- should we be using Google an event filter instead, or is it equivalent
(just want to catch keyboard focus changes)

Oliver
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20160826/10192c9b/attachment.html>


More information about the PyQt mailing list