The essence of the delegate lies in the delegation of rights to edit model data to a separate widget. If a delegate is used and cell modification is supported, then the corresponding editor widget must be created.
In some cases, for example, when using switches, this may seem redundant, however, it is often important to provide the ability to cancel the user's gestures in order not to disturb the model once more with random clicks with or without clicks.
If the task is to go your own way, different from the generally accepted one, and change the values in the cells for the click event, then it is probably better to stop using delegates altogether.
In QTableView
override mouse events or connect to QItemSelectionModel
signals, which are available via QAbstractItemView::selectionModel()
. And then, based on the input data about the cell in which the mouse was clicked, change the corresponding data in the model.