[PyQt] no access to protected functions or signals for objects not created from Python

disconnext disconnexttt at gmail.com
Tue Jan 25 13:10:18 GMT 2011


I need a main window catching all keyboard events, but with all child
widgets (hundreds of them) working correctly. So I try:

class MainWindow(QMainWindow):

    def __init__(self, parent=None):
        super(MainWindow, self).__init__(parent)
        self.grabKeyboard()
        ......

    def keyPressEvent(self, event):
        ..........
        self.focusWidget().keyPressEvent(event)



I got this error
RuntimeError: no access to protected functions or signals for objects
not created from Python


Is there any workaround?





More information about the PyQt mailing list