So, network proxy was the problem.
Needed to add qnetwork and needed to add
QNetworkProxyFactory::setUseSystemConfiguration(true);
QNetworkProxyFactory::setUseSystemConfiguration(true);
To copy to clipboard, switch view to plain text mode
to get the system proxy settings.
Only small problem left:
i do get exceptions from sysfer.dll which happen if the following is executed:
view
->setSource
(QUrl("qrc:/map.qml"));
view->setSource(QUrl("qrc:/map.qml"));
To copy to clipboard, switch view to plain text mode
Here are the files:
QML:
import QtQuick 2.3
import QtPositioning 5.6
import QtLocation 5.6
Map {
id: map
width: 640
height:480
plugin: Plugin {
name: "osm"
}
center {
latitude: -27
longitude: 153
}
zoomLevel: 10
gesture.enabled: true
Component.onCompleted: {
console.log("Dimensions: ", width, height)
}
}
import QtQuick 2.3
import QtPositioning 5.6
import QtLocation 5.6
Map {
id: map
width: 640
height:480
plugin: Plugin {
name: "osm"
}
center {
latitude: -27
longitude: 153
}
zoomLevel: 10
gesture.enabled: true
Component.onCompleted: {
console.log("Dimensions: ", width, height)
}
}
To copy to clipboard, switch view to plain text mode
Mainwindow.cpp:
{
// embed resources into binary
// infos: http://doc.qt.io/qt-5/resources.html
Q_INIT_RESOURCE(qmlsources);
this->resize(1024, 768);
createActions();
createMenus();
QQmlEngine *engine = new QQmlEngine(this);
QQuickWidget *view = new QQuickWidget(engine, this);
view
->setSource
(QUrl("qrc:/map.qml"));
this->setCentralWidget(view);
view->setResizeMode(QQuickWidget::SizeRootObjectToView);
MainWindow::MainWindow() : QMainWindow ()
{
// embed resources into binary
// infos: http://doc.qt.io/qt-5/resources.html
Q_INIT_RESOURCE(qmlsources);
this->resize(1024, 768);
createActions();
createMenus();
QQmlEngine *engine = new QQmlEngine(this);
QQuickWidget *view = new QQuickWidget(engine, this);
view->setSource(QUrl("qrc:/map.qml"));
this->setCentralWidget(view);
view->setResizeMode(QQuickWidget::SizeRootObjectToView);
To copy to clipboard, switch view to plain text mode
main.cpp:
int main(int argc, char *argv[])
{
// load resources from binary
// infos: http://doc.qt.io/qt-5/resources.html
Q_INIT_RESOURCE(qmlsources);
QNetworkProxyFactory::setUseSystemConfiguration(true);
MainWindow mw;
mw.show();
return a.exec();
}
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// load resources from binary
// infos: http://doc.qt.io/qt-5/resources.html
Q_INIT_RESOURCE(qmlsources);
QNetworkProxyFactory::setUseSystemConfiguration(true);
MainWindow mw;
mw.show();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Bookmarks