//model 읽는 작업이고
QString temp=model->index(1,1).data().toString();
QStandardItem * colorItem = new QStandardItem(temp);
// colorItem->setData(Qt::AlignCenter,Qt::TextAlignmentRole);
colorItem->setData(QVariant(QBrush(Qt::red)), Qt::BackgroundRole);
model->setItem(1,1,colorItem);
// 0번째 컬럼을 클리어하고 체크박스를 넣어야 함
-----
QStandardItem * colorItem = new QStandardItem(" put the text" );
-----
QString temp=model->index(1,1).data().toString();
QStandardItem * colorItem = new QStandardItem(temp);
// colorItem->setData(Qt::AlignCenter,Qt::TextAlignmentRole);
colorItem->setData(QVariant(QBrush(Qt::red)), Qt::TextColorRole);
model->setItem(1,1,colorItem);
'OLD개발이야기 > Qt ' 카테고리의 다른 글
QT: cell클릭 말고, 하나의 셀을 클릭했을 때 전체 row 받고 싶을 때 (0) | 2017.04.28 |
---|---|
[translation]QT: why delete() delete everything in QlineText? (0) | 2017.04.28 |
Qt: read text and set in Tableview (0) | 2017.04.20 |
QT: Read text (0) | 2017.04.20 |
[solved] QT - Push button image / label image (0) | 2017.04.20 |