Ehm, QTreeView with a QSqlTableModel or QSqlQueryModel. That's the standard case for them. Seriously, spend some time to read the parts about model and views at the docs. It might be difficult in the first place BUT it will save you a lot of pain in the a***!
Use QTreeView!
Bookmarks