Change value in table view in spin box
Unsolved
General and Desktop
-
Hello
I am trying to change a value in a table view with spin box.When i change the value in a spin box the value present in table view should change accordingly.
I have a database displayed in the table view. I just want to connect a spinbox to a related value in the table view and update when spinbox value is changed.
Thank you. -
// QSpinBox* mySpinBox; //QSqlQueryModel *model; // int rowIndex,colIndex; QObject::connect(mySpinBox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),[model,rowIndex,colIndex](int val)->void{ model->setValue(model->index(rowIndex,colIndex),val); });