How can i retrieve a qtableview from stored procedure?
Unsolved
General and Desktop
-
2 things:
- A table view can't hold data, it needs a model: http://doc.qt.io/qt-5/model-view-programming.html
- A stored procedure is likely a forward only query so you cannot use QSqlQueryModel out of the box
You'll need to run the query manually and add the results into a model (QStandardItemModel?).
To see how to prepare a query see the stored procedure section of http://doc.qt.io/qt-5/qsqlquery.html#approaches-to-binding-valueshere is some (horrible) code in which I download data from a stored procedure and populate a tree model with it, I hope it helps