[Qt-interest] QLineEdit - textChanged signal - determine old value

Colin S. Miller no-spam-thank-you at csmiller.demon.co.uk
Mon Sep 14 14:39:25 CEST 2009


Ender EREL wrote:
> You can keep an internal QString storing the value whenever the text 
> changes. You can use that value to get the last text.
> 
> void textChanged(const QString& newText)
> {
>     if(myOldText != newText)
>     {//Do Stuff
>     }
> 
>     myOldText = newText;
>     return;
> }
> 
> 
> 

Ah. Thought it might be something like that.
The problem is there are a large number of the QLineEdit
controls which are are connected to the same slot.

Is there any way for a derived instance of QLineEdit to tell
when all the signal-slots have completed, so it can
update its internal record of its old state to its
current state?


Or am I better keeping track of the focus change in the
QLineEdits (I'm all ready doing this),
and grabing the current (soon to be old) value of the control
when a QLineEdit gains focus?


TIA,
Colin S. Miller

--
Replace the obvious in my email address with the first three letters of the hostname to reply.




More information about the Qt-interest-old mailing list