Search code examples
qtqtablewidgetemit

emit signal when value of Qdoublespinxbox changed inside customDelegate


i have subclass qstyleditemdelegate

in col==1 and col==2 i have create Qdoublespinxboxs, i want to emit valuechanged of my

Qdoublespinxbox, to calculate a subtotal ( col1 * col2 )

means : ouside the delegate

every time the value of Qdoublespinxbox changed i will update the value subtotal


Solution

  • you can add signal to your QStyledItemDelegate subclass, emitted in setModelData() reimplementation. Signal should have information about new value and possible locate of data. In other class catch that signal and update the value subtotal.