Qt QSqlQueryModel::setQuery control what display in in the column
-
wrote on 26 Mar 2012, 13:19 last edited by
Im using :
@QString query = "SELECT foo,n1,n2 FROM play_list";
QSqlQueryModel::setQuery(query, queryDB);@in QSqlQueryModel subclass , but i dont want to display all the results that i getting from the select , i want to use the data and display only foo in the display and others results in others things . how can it be done?
-
wrote on 26 Mar 2012, 20:44 last edited by
Hide column in the view, not in the model.
For exemple :
@QTableView::setColumnHidden ( int column, bool hide )@ -
wrote on 1 Apr 2012, 07:55 last edited by
but i like to use the data from the other columns
-
wrote on 5 Apr 2012, 10:10 last edited by
Subclassing [[Doc:QSortFilterProxyModel]] and reimplementing method filterAcceptsColumn() should do the trick.
-
wrote on 9 Apr 2012, 11:20 last edited by
Hiding the data from the view does not stop you from using the data in other contexts...
3/5