Home > Mobile > Consult, I custom itemdelegate, setEditorData never trigger, how to return a responsibility?
Consult, I custom itemdelegate, setEditorData never trigger, how to return a responsibility?
Time:10-03
QWidget * createEditor (QWidget * parent, const QStyleOptionViewItem & amp; Option, const QModelIndex & amp; The index) const; CreateEditor is normal, read the data from the model initialization, can be;
But, no matter how to modify the values in the model, setEditorData never trigger; The inside of the qDebug never print; I don't know how to return a responsibility? Void CPushButtonItemDelegate: : setEditorData (QWidget * editor, const QModelIndex & amp; The index) { QDebug () & lt; & lt;" SetEditorData. "; //* * * * * * * * * * }
CodePudding user response:
Under normal circumstances, when you finish editing an item content of cells, press enter to enter at this time, will trigger the virtual function