Using an Eventfilter
Unsolved
General and Desktop
-
In the case of a form, you simply identify the field by its name:
ui->field1
ui->filed2
etcin your slot you can do:
void doubleClickOnField() { QObject* obj=sender(); if(obj==ui->field1) { } else if(obj==ui->field2 {} ... etc }
Also, you will need to do a cast to retreive the particular object data. For ex:
QLineEdit* edit=qobject_cast<QLineEdit*>(sender()); if(edit !=nullptr) // beware could be null { QString text=edit.tex(); }
-
Not trying to undermine your efforts but I think your users are going to be pretty surprised.
Personally, I don't expect anything other than text selection when I double click on a line edit type widget.
If a report shall be generate, I would rather have an explicit button for that.