This can be done by implementing a special editor of the cell.
Another variant. Grid has a mechanism which allows you to add buttons to any cell with any editor.
GridTableColumn::addButton(CellButtonKind kind = SelectButton, CellButtonPosition position = RightPosition, CellButtonActivatePolicy policy = FixedPolicy, const QIcon& icon = QIcon());
Below code to do that:
Qtitan::GridTableColumn* column = (Qtitan::GridTableColumn *)view->getColumnByModelColumnName("Date");
column->addButton(Qtitan::ClearButton, Qtitan::RightPosition, Qtitan::MouseOverPolicy);
connect(column, SIGNAL(buttonClicked(CellButtonClickEventArgs*)), this, SLOT(cellButtonClicked(CellButtonClickEventArgs*)));
.....
void Window::cellButtonClicked(CellButtonClickEventArgs* args)
{
QMessageBox::information(this, tr("Cell button clicked (new)"),
tr("Clicked: Button - %1, Column Title - %2, RowIndex - %3").arg(args->buttonIndex()).arg(args->column()->caption()).arg(args->row()->rowIndex()));
}
There's only one problem. In the current implementation a text can not be assigned to button.
If you find this solution acceptable, we will add the possibility to assign the text to the button in the next release.