Verification: reproduced locally (Windows, MSVC 14.51, Qt 6.11.1, offscreen) with DynamicForm as on master 05222af (the probe ran on a branch that does not touch the code involved). Not seen in CI; no CI case drives it.
withoutAutoSubmit(body) decrements programmaticEdit before its closing revalidate():
function withoutAutoSubmit(body) {
form.programmaticEdit++
try { body() } finally { form.programmaticEdit-- }
form.revalidate() // runs unsuppressed
}
Every control's Component.onCompleted re-seed goes through it, and a tab switch rebuilds every control of the tab. On a form that is already ready in the default auto-submit mode, each of those closing passes calls controller.submitIfValid. Probe (two tabs, one required integer, typed once, then tab 1 → 0):
QDEBUG : TabResubmit::test_switch() qml: submissions after typing 1 after two tab switches 9
FAIL! : TabResubmit::test_switch() Compared values are not the same
Actual (): 9
Expected (): 1
The header comment on programmaticEdit states the intent ("repopulating a form is not a user action and must never fire one"); the helper does not keep it. resetFields() escapes only because a cleared form is not ready. #817's prefill() hit the same thing and runs its final revalidate inside the window instead.
Fix: move form.revalidate() into the try block (before the decrement). Closes when the probe above reports 1.
Verification: reproduced locally (Windows, MSVC 14.51, Qt 6.11.1, offscreen) with DynamicForm as on master 05222af (the probe ran on a branch that does not touch the code involved). Not seen in CI; no CI case drives it.
withoutAutoSubmit(body)decrementsprogrammaticEditbefore its closingrevalidate():Every control's
Component.onCompletedre-seed goes through it, and a tab switch rebuilds every control of the tab. On a form that is alreadyreadyin the default auto-submit mode, each of those closing passes callscontroller.submitIfValid. Probe (two tabs, one required integer, typed once, then tab 1 → 0):The header comment on
programmaticEditstates the intent ("repopulating a form is not a user action and must never fire one"); the helper does not keep it.resetFields()escapes only because a cleared form is not ready. #817'sprefill()hit the same thing and runs its final revalidate inside the window instead.Fix: move
form.revalidate()into thetryblock (before the decrement). Closes when the probe above reports 1.