[SOLVED] QTableWidgetItem no data only check flag
-
I've got some QTableWidget, and initializing items like this:
@QTableWidgetItem * item = table->item(i,j);if(item == NULL)
{
item = new QTableWidgetItem();
item->setFlags(Qt::NoItemFlags);
m_ui->tableWidget->setItem(i,j,item);
}if(m_ec.matrix[headerId_i][headerId_j]) // value
item->setData(Qt::CheckStateRole, Qt::Checked);
else
item->setData(Qt::CheckStateRole, Qt::Unchecked);if(m_rn.matrix[headerId_i][headerId_j]))// readonly
item->setFlags(Qt::NoItemFlags);
else
item->setFlags(Qt::ItemIsEnabled|Qt::ItemIsUserCheckable);@
I mean I need checkable items in table with maybe some UserRole data and toolTips but w/o Display data. I get this but I still have some space in cells of my table. The question is how to remove or maybe hide these empties ? -
Thanks. I think it's really don't worth it to make a delegate. I asked because I don't know simple method but maybe someone knows. I resize my column close enough but some header text is bigger then 3 symbols long, so there is no way to do SIMPLE nice look, without using delegate.
-