You could try blocking the combobox signals in setModelData until you've returned from model->setData()
See QObject::blockSignals()
Cheers,
_
You could try blocking the combobox signals in setModelData until you've returned from model->setData()
See QObject::blockSignals()
Cheers,
_
Ah, I see. Since you were using QStandardItemModel I assumed it had all data itself. Something like that is usually done via a custom model.
Anyway, block the signal when "resetting" the comboBox. Right now you commit twice, once when the user changes the value and once when your "reset".
And maybe when setEditorData() changes the content. After all there is no point in notifying the model about data it provided itself.
Cheers,
_
aresa (4th December 2013)
I googled for hours and found a nice signal called 'activated' ,
This signal is only emitted when the current index is set by user click.
Not pragmatically. So by connecting this with 'emitDataChanged' the second
Call to QItemDelegate::setModelData is effectively avoided.
This is almost what i want except that the 'actived' signal is also
Emitted even if the current index is not changed by user click.
Anyway this is easy to handle.
Thanks for your replies, happy programming with you.
Bookmarks