0

How PyQt5 keyPressEvent works

this code really work but i want know somthing

the main window (as the class) it inherited (QMainWindow, Ui_MainWindow)

as i go to QMainWindow.py there are keyPressEvent(self, *args, **kwargs)

so i modified qwindow.py ex)

def keyPressEvent(self, *args, **kwargs): # real signature unknown
    print("this is test")
    pass

but when i run the program it doesn't work

i want to modify qmainwindow.py so it can work any sysytem without inherted it

is there any idea?

Arnav Borborah
  • 11,357
  • 8
  • 43
  • 88
  • QMainWindow.py ?, is a bad practice that a file is called like a class that is part of a library (it can bring you silent problems in the future), on the other hand that means it does not work, check the [tour], read [ask] and also provide a [mcve] – eyllanesc Sep 05 '18 at 15:01
  • thankyou i really use that method but really curious about this thing... and im new here and..im not good at english so it takes time to accustom how to ask.. really sorry – 이영호 Sep 05 '18 at 16:55

0 Answers0