Hi,
for one of our projects we are using a thirdparty qml plugin. They provide an installer which installs a folder in C:\Qt\5.7\msvc2013_64\qml(\ArcGIS...), a folder in C:\program files and adds a template project to qt creator. When I create a sample project with their template in qt creator and build/run it, everything works fine. When I use the Qt VS add in to convert it to a vs project, it compiles, but when it runs i get the following error:
QQmlApplicationEngine failed to load component
qrc:/qml/main.qml:16 plugin cannot be loaded for module "ArcGIS.Runtime": Cannot load library C:\Qt\5.7\msvc2013_64\qml\ArcGIS\Runtime.10.26\Arc GISRuntimePlugind.dll: The specified module could not be found. (the dll is there at that location)
int __cdecl main(int,char *[]) QObject(0x0)
Error: Your root item has to be a Window.
According to their install instructions (https://developers.arcgis.com/qt/qml...on-windows.htm) they use the vs compiler in qt creator to compile the projects, so i guess it's not a compiler compatibility issue.
What can be the difference between the qt creator project and the vs project? Are there some input paths that are different or so? Anybody an idea?
Here's the code:
main.qml:
import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
ApplicationWindow {
id: appWindow
width: 800
height: 600
title: "TestApp"
Map {
anchors.fill: parent
focus: true
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
}
}
import QtQuick 2.3
import QtQuick.Controls 1.2
import ArcGIS.Runtime 10.26
ApplicationWindow {
id: appWindow
width: 800
height: 600
title: "TestApp"
Map {
anchors.fill: parent
focus: true
ArcGISTiledMapServiceLayer {
url: "http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
}
}
}
To copy to clipboard, switch view to plain text mode
Main.cpp:
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine appEngine;
appEngine.
load(QUrl(kApplicationSourceUrl
));
auto topLevelObject = appEngine.rootObjects().value(0);
qDebug() << Q_FUNC_INFO << topLevelObject;
auto window = qobject_cast<QQuickWindow *>(topLevelObject);
if (!window)
{
qCritical("Error: Your root item has to be a Window.");
return -1;
}
int main(int argc, char *argv[])
{
QGuiApplication app(argc, argv);
QQmlApplicationEngine appEngine;
appEngine.addImportPath(QDir(QCoreApplication::applicationDirPath()).filePath("qml");
appEngine.load(QUrl(kApplicationSourceUrl));
auto topLevelObject = appEngine.rootObjects().value(0);
qDebug() << Q_FUNC_INFO << topLevelObject;
auto window = qobject_cast<QQuickWindow *>(topLevelObject);
if (!window)
{
qCritical("Error: Your root item has to be a Window.");
return -1;
}
To copy to clipboard, switch view to plain text mode
Jan
Ps: They don't use VS themselves so they could not help me with the issue...
Bookmarks