looks like the order of the fields is not as you expected (seems like column 1 is "security"; you can check by displaying the QSqlTableModel in a QTableView).

How about this approach:
populate (access columns by name) a QSqlRecord (you get an empty one with record()) and insert it with QSqlTableModel::insertRecord()
This way your code does not depend on the order of the columns in the table.

HTH