Hi

how can i save and load the items for a QTreeWidget(TreeModel) line by line. My current table looks like this(ListModel):

Qt Code:
  1. CREATE TABLE tree
  2. (
  3. ID integer NOT NULL PRIMARY KEY AUTOINCREMENT,
  4. entries varchar (50) NOT NULL
  5. );
To copy to clipboard, switch view to plain text mode 

and i load it by
Qt Code:
  1. for (int i=0; i<allEntries.size(); i++)
  2. {
  3. item=new QTreeWidgetItem(ui.treeWidget);
  4. item->setText(0, allEntries.at(i).getName());
  5. }
To copy to clipboard, switch view to plain text mode 

Now i want add a field (index) to my database, and store the the current TreeModel-Index within to add rows under a row. How can i do that?