Adding Custom Widget to cell of QTableView
-
I want to add a custom widget to the cell of a QTableView. The widget is not editable by the operator. It is a simple radio button with a label.
First off, yes, there are a lot of examples doing this with a delegate when you want the operator to click the cell and 'edit' it.What I cannot find is a way to add a "view/read only" custom widget to a QTableView.
I have read about openPersistientEditor but also read warnings that this will lead to performance issues with larger tables.
I am using this approach and also notice the memory footprint of my application growing over time. That has me a bit concerned.Yes, I could 'paint' the custom widget in the paint function of the QItemDelegate derived class I have assigned to my table view but that seems overly complicated, especially when I want to use all the features of a QRadioButton. Simply put i want to add an instance of a class derived from QRadioButton to a cell in the table view. There doesn't seem to be a simple way to do this, at least that I can find.
If there is a straight forward example of doing this, can you point me to it.
Thank you.
-Ed.