map viewer/places examples: Brush up the code


- Use modern string literals
- Use the variadic template version of QMetaObject::invokeMethod()
- Use modern connect syntax
- Reorder includes
- Trim newlines in QML

Fix minor bugs:
- Skip empty elements of library path (namely when variable is not
  set)
- Fix the check for osm.useragent to operate on the map
- Exit cleanly on QML loading errors

Since places uses similar code, apply the changes there as well.

Pick-to: 6.5 6.5.0
Change-Id: Ibaeffc6e003c55c458137458c5017584e0c072f1
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
commit20b0c2fb20f3c37c2549b7aa59f686a7726a2817
parent2a05e3206af01b7edc05e154a71dfd7e6c44c6f0
authorFriedemann Kleint <Friedemann.Kleint@qt.io>
committerVolker Hilsheimer <volker.hilsheimer@qt.io>
commit timeTue, 7 Mar 2023 17:52:18 +0000