What im trying to do is have a table which does not appear editable directly but can be edited in some widget outside the table. That is, the selected node can be edited here, and all nodes use the same editor because i want it to always be shown.
What I've tried is to subclass QItemDelegate and just return the instance of QTextEdit i already have, like this:
class Delegate extends QItemDelegate {
@Override
public QWidget createEditor(QWidget parent, QStyleOptionViewItem option, QModelIndex index) {
return qtextEdit;
}
}
which works, except that when you leave the editor it gets destroyed. Maybe delegate isn't supposed to be used this way. So how can i achieve this?
(ps. im using jambi but c++ code is fine)