Hi Community,

i would like to embed an QML-Map into a widget.
From general: i have successfully embedded a text (QML) with the following code:

Qt Code:
  1. QQmlEngine *engine = new QQmlEngine(this);
  2. QQuickWidget *view = new QQuickWidget(engine, this);
  3. view->setSource(QUrl("qrc:/test.qml"));
  4. this->setCentralWidget(view);
To copy to clipboard, switch view to plain text mode 

test.qml is taken from an example.

Embedding the following Map.qml does yield to syntax error at line 13. I doubt the reason is that i don't have a "parent".
Qt Code:
  1. import QtQuick 2.0
  2. import QtLocation 5.3
  3.  
  4. Plugin {
  5. name: "osm"
  6. PluginParameter { name: "osm.useragent"; value "MapViewer"}
  7. PluginParameter { name: "osm.mapping.host"; value: "http://osm.tile.server.address/" }
  8. PluginParameter { name: "osm.mapping.copyright"; value: "All mine" }
  9. PluginParameter { name: "osm.routing.host"; value: "http://osrm.server.address/viaroute" }
  10. PluginParameter { name: "osm.geocoding.host"; value: "http://geocoding.server.address" }
  11. }
  12.  
  13. Map {
  14. id: map
  15.  
  16. plugin: osm
  17.  
  18. zoomLevel: map.minimumZoomLevel
  19.  
  20. center {
  21. // The Qt Company in Oslo
  22. latitude: 59.9485
  23. longitude: 10.7686
  24. }
  25. }
To copy to clipboard, switch view to plain text mode 
The code shall be embedded in a qwidget because it is part of an existing library that is loaded into a main application.
Could someone give me a hint where i can find a good example? The mapviewer example vom QT-documentation does not hold enough background information how to create a qwidget holding a QML-Map.

Thx!!!!