Inserting a Custom Widget inside a QTableView Cell
Hi,
I searched in the forum but I didn't find any good solution...I want to show in a QTableView Cell a custom widget (composed by 2 QCheckBox and 1 QSpinBox) which control/edit a specific data in my model.
I created a custom QItemDelegate in order to show the custom widget inside the cell at editing time (there are several example exaplining how to implement this)...my next feature is showing the custom widget at not editing time, i.e. I want to permanently show the custom widget inside the cell (cell Editable/NotEditable mode) without any other action on cell in order to select/edit cell...
Do you save some idea about this feaure implementation?
Thanks
Re: Inserting a Custom Widget inside a QTableView Cell
I suggest you search again, the issue has been discussed many times.
Re: Inserting a Custom Widget inside a QTableView Cell
but through QItemDelegate we can only display the widget during editing the cell..
Is there any way to display it permanently ?
Re: Inserting a Custom Widget inside a QTableView Cell
Well, you can use QAbstractItemView::openPersistentEditor, but it can "slow down" your view if there are a lot of data.
I would suggest to grab an editor using QPixmap::grabWidget or even better to render it using QWidget::render in the item's delegate QItemDelegate::paint method.