If someone interesting you can solve problem like this:
C++ side:
QVariantMap params
{
{"osm.mapping.highdpi_tiles", YOUR_CUSTOM_VALUE},
{"osm.mapping.offline.directory", YOUR_CUSTOM_VALUE},
{"osm.mapping.cache.directory", YOUR_CUSTOM_VALUE}
};
QQuickView *view = new QQuickView;
view->setSource(QUrl(QStringLiteral("qrc:/qml/OSMView.qml")));
QObject *item = (QObject *) view->rootObject();
QMetaObject::invokeMethod(item, "initializePlugin", Q_ARG(QVariant, QVariant::fromValue(params)));
QML side:
Item
{
id: osmMain
property variant parameters
function initializePlugin(pluginParameters)
{
var parameters = new Array;
for(var prop in pluginParameters)
{
var parameter = Qt.createQmlObject('import QtLocation 5.6; PluginParameter{ name: "'+ prop + '"; value: "' + pluginParameters[prop] + '"}', map)
parameters.push(parameter)
}
osmMain.parameters = parameters
map.plugin = Qt.createQmlObject('import QtLocation 5.6; Plugin{ name: "osm"; parameters: osmMain.parameters }', osmMain)
}
Map { id: map <...> }
<...>
}