Solved QTreeView with Data from Database
-
I want to build a TreeView with Data from a Database and i have much Problems to code it. Anyone can tell me a good Database Structure for a TreeView?
I followed this Tutorial, but i cant show anything in my TreeView. Maybe someone has a good Link to a Tutorial or Examplecode.
http://doc.qt.io/qt-5/qtwidgets-itemviews-simpletreemodel-example.html -
hi
the SQL model is not good enough for your needs?
http://doc.qt.io/qt-5/sql-model.html -
i dont know here the first Time of it. How can i use it with TreeView and what Tablestructure i need?
QAbstractProxyModel looks good too, but at the moment i have no idea how to implement it.
-
@Fuel
start by reading about model and view
http://doc.qt.io/qt-5/model-view-programming.html -
I know the Model View Pattern. But its hard to understand how the Abstractitemmodel is working. But slowly step for step i make progress
-
@Fuel
yes there is a lot of details when making your own model.
the sqlmodel can already show the data from a db.
there is also a table view for sql table.
so I assume the normal SQL MODELS classes didnt not do as u wanted.