[Solved]Add index value to database in QListWidgetItem
General and Desktop
3
Posts
2
Posters
1.5k
Views
1
Watching
-
Is there a way to add my QSqlQueryModel to a QListWidget? Or is there a way to add the database row id to a QListWidgetItem? I cant figure this out from the "documentation":http://qt-project.org/doc/qt-4.8/qlistwidgetitem.html.
-
Hmm, think your missing the point of the Model/View or widget/View use. For your database you should use the Model/View system, so it would be a QListView instead off a QListWidget. When the database has multiple colums maybe using the QTableView is more appropriate. In the model you control the way the view presents its data. Hope this helps, otherwise supply some code for us to debug/check.