Hi! I have a SQLite database with a table names monitored_directories. I would like to list the column original_path of this table in a QListWidget, where I can then edit the elements to upgrade my database. After reading documentation and examples I came up with this:

Qt Code:
  1. tableModel = new QSqlRelationalTableModel(this, LBTGlobals::getInstance()->dbManager->db);
  2. tableModel->setTable("monitored_directories");
  3. tableModel->select();
  4. mapper = new QDataWidgetMapper(this);
  5. mapper->setModel(tableModel);
  6. mapper->setItemDelegate(new QSqlRelationalDelegate(this));
  7. mapper->addMapping(listDir, tableModel->fieldIndex("original_path"));
  8. mapper->toFirst();
To copy to clipboard, switch view to plain text mode 

The QListWidet listDir is empty, event if I have records in the table. What am I doing wrong?
Thanks for any advice!