Hi
how can i save and load the items for a QTreeWidget(TreeModel) line by line. My current table looks like this(ListModel):
CREATE TABLE tree
(
ID integer NOT NULL PRIMARY KEY AUTOINCREMENT,
entries varchar (50) NOT NULL
);
CREATE TABLE tree
(
ID integer NOT NULL PRIMARY KEY AUTOINCREMENT,
entries varchar (50) NOT NULL
);
To copy to clipboard, switch view to plain text mode
and i load it by
for (int i=0; i<allEntries.size(); i++)
{
item->setText(0, allEntries.at(i).getName());
}
QTreeWidgetItem* item;
for (int i=0; i<allEntries.size(); i++)
{
item=new QTreeWidgetItem(ui.treeWidget);
item->setText(0, allEntries.at(i).getName());
}
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?
Bookmarks