Fix history state index handling


The history state is not present in the generated statemachines,
and the states following a history state have a state index that is
lower than what the actual statemachine considers. This patch adjusts
the index calculation on the statemachine side.

The scion test suite history tests passed because it used the
activeStateNames() method for verifying which states are active.
That method worked. This commit also now amends the scion
verification to cover the metaobject access and (de-)activation
signal emissions; the scion history tests would now fail without
the index handling adaptation of this patch.

Pick-to: 6.2 6.4 5.15
Fixes: QTBUG-80262
Change-Id: Ifc509794bf3dca6c81e969e8a4e2bbaf9618d275
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
commit50815b095f1ccea936c89964e390e7e774efbf4b
parentf73d49a76002b9bf7ba426ea28b8e22fbfe9ca7c
authorJuha Vuolle <juha.vuolle@insta.fi>
committerJuha Vuolle <juha.vuolle@insta.fi>
commit timeTue, 1 Nov 2022 08:48:43 +0300