Fix mapviewer example issues and modernize code


Move the example away from imperative coding style, and fix code that
didn't following Qt 6 practices or caused warnings to be emitted to the
console:

Populate all menus consistently through items that bind their enabled
state to relevant properties. This avoids that we have to clear and
recreate the menus when switching provider.

Don't print debug output when updating the position of the minimap.

Capture parameters of signals correctly in the handlers.

Fix some UI issues:

We cannot replace the background of a styled button, so use
AbstractButton instead, otherwise the example will generate runtime
warnings with some styles, e.g.

qrc:/qt-project.org/imports/QtQuick/Controls/macOS/Button.qml:44:
TypeError: Property 'styleFont' of object QQuickRectangle(0x7fdfaa4e7bd0)
is not a function

Also don't squeeze the sliders by setting the spacing to -10, styled
sliders will overlap, and don't use anchors on items managed by layouts.

Change-Id: I118a52ae3d2ece77c662fd42bb868c9bbcf30e7a
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
commitab4b06741ee2dbb70e43ae1660d6ccca4913a32c
parent31c94ac5a7d905312e4459d44c24cbe5f105dc9d
authorVolker Hilsheimer <volker.hilsheimer@qt.io>
committerVolker Hilsheimer <volker.hilsheimer@qt.io>
commit timeTue, 20 Sep 2022 12:10:38 +0200