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

CodePudding user response:

reference 1st floor dinjay response:
under normal circumstances, when you finish editing a content item cell, press enter to enter at this time, will trigger the virtual function

Thank you, forgot to say, I don't have a double click the item to modify, and directly modify item corresponding to the value in the model, so it hasn't been triggered it

CodePudding user response:

refer to the second floor is not easy to easy to reply:
Quote: refer to 1st floor dinjay 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

Forget to say thank you, I don't have a double-click on the item to modify, and directly modify item corresponding to the value in the model, so it hasn't been triggered it


CodePudding user response:

reference demonic disease response: 3/f
Quote: refer to the second floor is not easy to easy to reply:

Quote: refer to 1st floor dinjay 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

Forget to say thank you, I don't have a double-click on the item to modify, and directly modify item corresponding to the value in the model, so it hasn't been triggered it




Why directly modify the corresponding values in the model, the item has been not trigger it?
  •  Tags:  
  • Qt