Quantcast
Channel: QtWebEngine
Viewing all articles
Browse latest Browse all 13965

Sql Tree Model/View

$
0
0
Hello all, I have a SQL table (SQLite) with the following structure: CREATE TABLE filters (id INTEGER PRIMARY KEY AUTOINCREMENT, name VARCHAR(30), key VARCHAR(30), parent INTEGER, FOREIGN KEY(parent) REFERENCES filters(id)) There is a column “parent” which indicates the parent of each item. I would like to load it in a QTreeView. I already get all the data from a QSqlTableModel but the table is flat, meaning with no parent-child relationship. How can I make this happen? Thanks in advance!

Viewing all articles
Browse latest Browse all 13965

Trending Articles