I have a dialog with a dismiss button, the clicked signal of which is linked to 
the dialog's accept() slot.

Elsewhere in the dialog I have a QLineEdit that I want the user to be able to 
enter a string into. I give the QLineEdit focus with setFocus() at dialog 
startup time. This works - when the dialog comes up the cursor is sat blinking 
in the QLineEdit and the user can immediately edit the contents as expected.

The problem is that when the user hits the Return key, the Dismiss button sees 
it and the dialog gets dismissed. I'm not sure if the keypress is just being 
grabbed by the Dismiss button or whether it's propogating upwards to it. Either 
way, my question is, what do I need to do to ensure the Return key press is 
acted on by the QLineEdit widget, and that widget only?

I should add that when the user has performed their text edit I want to give 
focus to the dismiss button. Thus doing the text edit then hitting return twice 
should see the edit accepted and the dialog dismissed. I'm having trouble 
getting this behaviour.



      

_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to