G'Day All,

I have a simple function called from a QLineEdit on form A.

connect( lineEdit, SIGNAL( editingFinished( ) ), this, SLOT( checkMainDatabase() ) );

When I enter some data in the lineEdit and press "Enter", the function checks the main database and if not found opens the "add new data" form, B, and the focus is then on the new form, B. This part works as I planned.

My problem is this: when I press "tab" instead of "Enter" the same thing happens except that form B is placed behind the original form, A, and focus is set on the next QlineEdit, lineEdit_2 in form A.

By clicking on the "add new data" form the focus changes and all works normally. It is just annoying having to go throught the process of regaining the focus.

I am guessing the reason is that a "tab" from a QLineEdit causes the focus to changed to the next (in my case) QLineEdit on the original form whereas an "Enter" indicates editing finished and focus is changed by the progam code as I have written.

I have tried putting a setFocus command in the checkMainDatabase() function as a work around but to no avail. I have tried setting focus to the form B and widgets within the form.

Is there a way around this? Any thoughts or suggested reading would be appreciated.


Cheers, B1.