Hi every one..
How can i change QTreeView vertical header?
the QTreeView is presenting QSqlQueryModel .
l tried to do it this way but it did not work :
qury.exec("select * from table;");
tableModel.setQuery(qury);
ui->tableWidget->setModel(&tableModel);
for (int i=0; i<=14;i++)
tableModel.setHeaderData(i, Qt::Vertical, stringList[i]);
QSqlQuery qury;
QSqlQueryModel tableModel;
qury.exec("select * from table;");
tableModel.setQuery(qury);
ui->tableWidget->setModel(&tableModel);
for (int i=0; i<=14;i++)
tableModel.setHeaderData(i, Qt::Vertical, stringList[i]);
To copy to clipboard, switch view to plain text mode
this code is working fine when i use it for the Horizontal header :
for (int i=0; i<=14;i++)
tableModel.setHeaderData(i, Qt::Horizontal , stringList[i]);
for (int i=0; i<=14;i++)
tableModel.setHeaderData(i, Qt::Horizontal , stringList[i]);
To copy to clipboard, switch view to plain text mode
any ideas ?
thanks in advanced ..
Bookmarks