Qt background color of row in ListStringModel
-
i try set color of row with this code and it doesnt work.
@ QColor dataColor =Qt::red;
row = seznamChyb->rowCount();
seznamChyb->insertRows(row,1);QModelIndex index = seznamChyb->index(row); ui->listView->setCurrentIndex(index); seznamChyb->setData(index,dataColor, Qt::BackgroundRole); seznamChyb->setData(index,data);@
-
Hi .
in line 8.
this is wrong setData() function parameter supplied wrong."Qt docs":http://qt-project.org/doc/qt-4.8/qabstractitemmodel.html#setData
so it will not work.hope this help.