VirtualKeyboard: fix popup list height calculation


PopupList and WordCandidatePopupList computed the total spacing of the
visible rows as `spacing * preferredVisibleItems - 1` instead of
`spacing * (preferredVisibleItems - 1)`. A list showing n items has
n - 1 gaps between them, not n gaps less one pixel.

Nothing in the module ever assigns spacing, so it is always the
ListView default of 0 and the expression reduces to -1: every popup
list ends up exactly one pixel shorter than the rows it displays, and
since clip is enabled the bottom pixel row of the last visible item is
cut off. Measured with the language popup of the basic example: five
items of 40.9375 pixels each produced a height of 203.6875 instead of
204.6875.

The error also changes sign the moment spacing is set, which would make
the list spacing - 1 pixels too tall.

Change-Id: Ie51ecd35a1278806a038dd634043c4679fcb8698
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
commit4936448433f3e13f269dabe951122390c76c79c8
parent433c4bd9672287297218e7287556ebaf0a6757f4
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>
commit timeWed, 29 Jul 2026 06:08:13 +0000