I try to edit numerical value in cells in TableWidget with keyboard and mouse scroll. I want to keep focus on selected cell unless confirmation of value with or mouse selection of another cell.
ParamTableWidget
::ParamTableWidget(QWidget *parent
) : TableWidget(parent)
{
connect(this, SIGNAL(cellChanged(int,int)),this, SLOT(slotCellChanged(int, int)));
}
void ParamTableWidget::slotCellChanged(int row, int column)
{
edit(model()->index(row,1));
}
ParamTableWidget::ParamTableWidget(QWidget *parent) :
TableWidget(parent)
{
connect(this, SIGNAL(cellChanged(int,int)),this, SLOT(slotCellChanged(int, int)));
}
void ParamTableWidget::slotCellChanged(int row, int column)
{
selectionModel()->select(model()->index(row,1), QItemSelectionModel::Select);
edit(model()->index(row,1));
}
To copy to clipboard, switch view to plain text mode
I can't discard a modified cell value and i can't escape from cell edit without .
Any idea where the bug is?
Bookmarks