taraj
17th October 2016, 23:54
Hi
I have the following code for a tableWidget. When I change a cell in the table and the cellChanged signal is called I get all cells in the table 'signalled' and I only want the one that was changed. I need to know the row and column that was changed which is why I am using cellChanged().
tableValueChanged outputs every row and column not just the changed one :(
What am I doing wrong?
Thanks in advance!
int row, col;
for(row = 0; row < tableWidget->rowCount(); row++)
{
for(col = 0; col < tableWidget->columnCount(); col++)
{
connect(tableWidget, SIGNAL(cellChanged(int,int)), this, SLOT(tableValueChanged(int, int)));
}
}
void className::tableValueChanged(int row, int col)
{
qDebug("value changed row = %d, col = %d", row, col);
}
I have the following code for a tableWidget. When I change a cell in the table and the cellChanged signal is called I get all cells in the table 'signalled' and I only want the one that was changed. I need to know the row and column that was changed which is why I am using cellChanged().
tableValueChanged outputs every row and column not just the changed one :(
What am I doing wrong?
Thanks in advance!
int row, col;
for(row = 0; row < tableWidget->rowCount(); row++)
{
for(col = 0; col < tableWidget->columnCount(); col++)
{
connect(tableWidget, SIGNAL(cellChanged(int,int)), this, SLOT(tableValueChanged(int, int)));
}
}
void className::tableValueChanged(int row, int col)
{
qDebug("value changed row = %d, col = %d", row, col);
}