In your loop that creates the QLineEdit, you can use the QObject::setProperty() method to associate a unique value with the widget (as a QVariant). You can also connect the QLineEdit::editingFinished() signal to a slot. In the slot, call sender() to retrieve the QLineEdit pointer, then use the QObject::property() method to retrieve the unique value you have stored for the widget. You can also use QLineEdit::text() to retrieve whatever the user has changed the text to.

You are going to have devise some way of connecting the widgets you create via XML to fields in a data structure, otherwise you will end up with widgets connected to slots that don't have any idea what to do with the data they have retrieved.

But there are a lot of problems with your design. How are you going to prevent users from entering incorrect values, for example? How will you enforce required fields (i.e. a field that cannot be left empty)? How can you set the tab order so that the tab key doesn't just take the user to random places in the grid each time it is pressed? What you will be creating is a dialog with no way to control what happens between the time the dialog is displayed until the time the user clicks OK or Cancel.