Qt QSqlQueryModel::setQuery control what display in in the column
-
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?
-
Hide column in the view, not in the model.
For exemple :
@QTableView::setColumnHidden ( int column, bool hide )@ -
but i like to use the data from the other columns
-
Subclassing [[Doc:QSortFilterProxyModel]] and reimplementing method filterAcceptsColumn() should do the trick.
-
Hiding the data from the view does not stop you from using the data in other contexts...