Код: Выделить всё
import QtQuick 2.5
import QtQuick.Window 2.0
import QtQuick.Controls 1.4
import QtLocation 5.5
import QtPositioning 5.5
ApplicationWindow {
title: "Mapper"
id: mapWindow
x: Screen.width / 2 - width / 2
y: Screen.height / 2 - height / 2
width: 1400
height: 800
visible: true
color: "#0b2f5c"
Map
{
id: basemap
objectName: "basemap"
property string inputStr: "import QtQuick 2.0; import QtLocation 5.0; import QtPositioning 5.0; "
anchors.fill: parent
anchors.rightMargin: 300
anchors.leftMargin: 25
anchors.topMargin: 50
anchors.bottomMargin: 50
plugin: Plugin
{
name: "osm"
PluginParameter
{
name: "osm.mapping.custom.host"
value: "https://a.tile.openstreetmap.org/"
}
}
activeMapType: supportedMapTypes[supportedMapTypes.length - 1]
center: QtPositioning.coordinate(0, 0)
zoomLevel: 2
minimumZoomLevel: 2
}
}
Код: Выделить всё
QQmlApplicationEngine* engine = new QQmlApplicationEngine(QUrl(""));
QObject* topLevel = mEngine->rootObjects().value(0);
QQuickWindow* window = qobject_cast(mTopLevel);
window->show();
Подробнее здесь: https://stackoverflow.com/questions/632 ... -to-cursor