Hi,

I have an application where user enters transaction entries in bulk and application saves it in database. I am using QTableView for transaction entry. It has 7 columns and 1 row by default. There is a button given to add more transaction rows.

Out of 7 columns one column is Transaction Type which is a QComboBox which should be populated from database table.

I am using Qt's Model-View-Delegate concept to show combobox and other widgets on each cell.

Query:

  1. How to populate combobox from database table in UI class (AddBankTrxns) ?
    I don't want to add sql queries in delegate class (ComboBoxDelegate).


Classes used :

AddBankTrxns : UI class where Transaction table is shown.
ComboBoxDelegate : Delegate class to show table cell as ComboBox.

Thanks in advance.