PDA

View Full Version : Search For Header name in QTableview, QsqlQueryModel



nagabathula
25th April 2011, 08:58
Hello ,

I have a QTableView in which i have displayed many columns with data. I wanted to keep a search function so that i can scroll to the searched column name. I wanted to use only the Header Names as the search query. so i have given a line edit with only the names of the tableview Headers. I am using QSqlQueryModel to display the data in the table view..


QSqlQueryModel *model1 = new QSqlQueryModel(tableView);
model1->setQuery("SELECT * FROM allhexdata");
tableView_2->setModel(model1);
how should i do that.