I want-to put-a customed-widget into the cell of QTableView
. The Widget can-be a QPushButton
, a checkBox or something else. I've tried following methods, but no-one satisfies me:
- Use delegate. This strategy can paint widget, but cant-be a customed widget, and cant interact.
- Use
QTableView::setIndexWidget()
. Using this strategy, the customed-widget covers the cell wholly & absolutely, delegate binded toQTableView
not working, which means a-double-click() wont make Edit operation on-the cell.
Note that the function is stand-alone, like a plugin. So I cant do following things.
- Inherit from
QTableView
. I can only get a-pointer-variable binded withQTableView
----only an object ofQTableView
. - Inherit from any-model. The model is control by other user, the programmer writing model shouldn't and can't just use my-customed model.
The problem is really complex and too-many constraints restrict the design.