The buttons can be added as delegates. They are visual mockups at that point - they look like buttons, but they don't act like buttons. The delegate can create a real button widget when the cell is entered. It's then a simple matter to set some properties on the button to indicate the function and row. Recall that QObject
has a flexible property system - see the setProperty
and property
methods. All widgets are QObject
s.
The receiver of the button's clicked
signal can use the sender()
method to access the sending button instance, and read the properties. You can also subclass the QPushButton
and emit a custom signal upon the button being clicked.