I have the classical QSqlRelationalTableModel situation where the customerModel is the master and the countryModel is the detail. The problem is that I don't want to display this model in a table, but show one record at a time in individual widgets using the QDataWidgetMapper.

How do I wire up the QComboBox that allows the user to pick the country?

Possible options:

  1. Make the customerModel a QSqlTableModel, pass a 3rd param to the addMapper function
  2. Make the customerModel a QSqlRelationalTableModel, wire up the relationship, and Qt does the rest.
  3. something else