[PyQt] Beginners - signal - slots - question

Doug Bell dougb at bellz.org
Fri Dec 21 11:16:33 GMT 2007


Jochen Georges wrote:
> Hello,
> 
> i finished my first "Hello-World"-PyQt-program sucessfully, 
> but not my second. 
> 
> I googled for an example, but did not find any, so maybe you can give me a 
> hint.
> 
> There is a QLineEdit-element and a QLabel-element.
> When te user finished editing the QLineEdit, the text should be changed and  
> then displayed in the QLabel.
> 
> Which is the right QLineEdit-Signal?
> 	the action should start when return is pressed, but the
> 	signal "returnPressed" has no parameter "QString"
> 	and
> 	textChanged(QString) or textEdited(QString) react on every single input
> How do i place my own method, that changes the text?

The "self.lineEdit.text()" method will return a QString.  Just call it
from the function tied to the "returnPressed()" signal.

Doug.


More information about the PyQt mailing list