[PyQt] newbie question about events without a signal/slot(?)

listen at gmx.eu listen at gmx.eu
Mon Mar 17 13:28:44 GMT 2008


hi, i'm brandnew to (Py)Qt and have a question i couldn't find an answer to by reading in the reference.

i have this very easy piece of code:

---

#!/usr/bin/env python

import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *

class Form(QDialog):
    def __init__(self, parent=None):
        super(Form, self).__init__(parent)
        
        layout = QVBoxLayout()
        
        self.line1 = QLineEdit("line1")
        self.line2 = QLineEdit("line2")
        
        layout.addWidget(self.line1)
        layout.addWidget(self.line2)
        
        self.setLayout(layout)        
        self.resize(500, 1)

app = QApplication(sys.argv)
form = Form()
form.show()
app.exec_()

---

now i want to react to the 'QLineEdit.focusInEvent', but i don't know how this works. just defining a 'def focusInEvent' didn't work and there's is no signal for this event?!

can someone please help me a bit?

regards, marcus


More information about the PyQt mailing list