Basically, I just want to clear a text field iff the user has "clicked" the text field and the enter/return key has been pressed. After some research I found that you must first set the focusPolicy
for each widget. Done.
dataSend_area->setFocusPolicy(Qt::ClickFocus);
And from this point I am lost. From what I can tell, I will need to implement a slot
function to implement a custom function for when these conditions are met. The pseudo-code presented below is about as far as I have gotten. I have searched through the Qt documentation and found little bits of information scattered about, but hardly any information regarding the coalescence of all of the functionality.
keyPressEvent(enter/return Key){
if ( textBox has focus )
//do
else
return
}