There is such a problem:

  • Python 2.7.2
  • PyQT4
  • The helloworld.pyw file hooks the editor.ui interface with the magic word widget = uic.loadUi("editor.ui")
  • The interface has widget.lcdNumber_3 , which has a mousePressEvent
  • By triggering a mousePressEvent you need to execute, say, def foo(): i=123

I climb on the forums, there all the clever questions are asked, but I cannot find an answer to such an elementary one. I ask for your help.

    1 answer 1

    All found. The decision turned out to be the dumbest.

    1. We write function

       dev foo(ev): i=123 
    2. widget.lcdNumber_3.mousePressEvent = foo .

    3. EVERYTHING! In the foo function, we also have event parameters.