[Qt 6] fix tests for Qt 6 builds
Qt 5 tests are fixed by
!608 (merged)
, but Qt 6 builds still have tests failing.