Trolltech Home | Qt-jambi-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-jambi-interest Archive, June 2007
Signal : textChanged and textEdited


Message 1 in thread

Hello

I've a question (that might not be a special QtJambi question).

I never get a 'textChanged' or 'textEditet' Signal from the QLineEdit 
when I delete the last charakter in a QLineEdit.

------------------------------------------

    this.m_ui.LineEdit.textEdited.connect(this,"OnEdit()");

or

    this.m_ui.LineEdit.textChanged.connect(this,"OnEdit()");

------------------------------------------

    Text    -> Text1  : SIGNAL
    Text    -> Tex    : SIGNAL
    NO_TEXT -> T      : SIGNAL
    T       -> NO_TEXT: NO SIGNAL


that seemes me a little bit strange. Of course I want to get the signal 
even if the last charactar will be deleted.

best regards
Arne


Message 2 in thread

Arne Stocker wrote:
> Hello
> 
> I've a question (that might not be a special QtJambi question).
> 
> I never get a 'textChanged' or 'textEditet' Signal from the QLineEdit 
> when I delete the last charakter in a QLineEdit.
> 
> ------------------------------------------
> 
>    this.m_ui.LineEdit.textEdited.connect(this,"OnEdit()");
> 
> or
> 
>    this.m_ui.LineEdit.textChanged.connect(this,"OnEdit()");
> 
> ------------------------------------------
> 
>    Text    -> Text1  : SIGNAL
>    Text    -> Tex    : SIGNAL
>    NO_TEXT -> T      : SIGNAL
>    T       -> NO_TEXT: NO SIGNAL
> 
> 
> that seemes me a little bit strange. Of course I want to get the signal 
> even if the last charactar will be deleted.

Hi Arne,

One certainly would like to get the signal for the last char too, but 
I've been unable to reproduce the problem you describe. I tried the 
example below on win64, linux32 and mac with the released package 
without and it does send the signal for all the three cases. Could you 
see if you could adapt it to reproduce the problem?

-
Gunnar

import com.trolltech.qt.gui.*;

public class LineEdit {

     public static void main(String args[]) {
         QApplication.initialize(args);

         final QLineEdit edit = new QLineEdit();
         edit.show();

         Object o = new Object() {
                 public void handleChanged() {
                     System.out.println("handleChanged: " + edit.text());
                 }

                 public void handleEdit() {
                     System.out.println("handleEdit: " + edit.text());
                 }
             };

         edit.textChanged.connect(o, "handleChanged()");
         edit.textEdited.connect(o, "handleEdit()");

         QApplication.exec();
     }
}