Qt 6.11 is out! See what's new in the release
blog
[Solved] How to set color to a tableview values from the database
General and Desktop
5
Posts
3
Posters
2.2k
Views
1
Watching
-
@ Log cnn;
QSqlQueryModel *modal=new QSqlQueryModel();
QSqlQuery *qry=new QSqlQuery(cnn.mydb);
qry->prepare("select *from AccessLog");
qry->exec();
modal->setQuery(*qry);
ui->tableView->setModel(modal);
qDebug()<<(modal->rowCount());
@
With this method i can set a QSQlQueryModels to my QTableviews.How i can set color to each row in tableview. -
Thanks.....
-
And also one method for this solution,In QtCreator UI Forms select the tablview control and change the property of styleSheet. It include the various options such as color,background color,border color etc.