Changing submit policy of QDataWidgetMapper to AutoSubmit because if multiple changes are made at once not all of them are applied.

This commit is contained in:
2026-01-01 09:52:24 +01:00
parent bcba8f8452
commit 683f5d224c
5 changed files with 20 additions and 8 deletions

View File

@ -15,7 +15,14 @@ ItemDetailMapper::ItemDetailMapper(QWidget* parent)
: QWidget{parent} {
/// model mapping
m_mapper = std::make_unique<QDataWidgetMapper>(this);
m_mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
/// BUG: If multiple columns are changed not all changes are applied.
/// Multiple changes are set individually by calling setData().
/// Probably due to a conflicting dataChanged signal for too many roles&columns the data of
/// the remaining columns is reset before setData is called.
/// And a manual submit would also create multiple undo steps anyway.
/// Workaround: ManualSubmit -> AutoSubmit
// m_mapper->setSubmitPolicy(QDataWidgetMapper::ManualSubmit);
m_mapper->setSubmitPolicy(QDataWidgetMapper::AutoSubmit);
/// model mapping buttons
m_nextButton = new QPushButton(tr("Ne&xt"));