I am trying to use AWS SDK (https://sdk.amazonaws.com/js/aws-sdk-2.0.30.js) in my Qt-Creator Project with the purpose of uploading an image to my S3 bucket.
I have copy-pasted the JavaScript above to a file named awsSdk.js and did the following in my main.qml file:
// main.qml
import QtQuick 2.3
import QtQuick.Window 2.2
import "jsTest.js" as JsTest
import "awsSdk.js" as AWSSdk
Window {
visible: true
width: 360
height: 360
Rectangle {
width: 360
height: 360
color: "white"
Text {
id: txt
anchors.centerIn: parent
text: "Counter"
color: "Blue"
}
MouseArea {
x: 0
y: 0
anchors.fill: parent
onClicked: {
if (JsTest.x>=20) {
console.log("Have a nice day :)");
Qt.quit();
}
else
txt.text = JsTest.jsTest();
}
}
}
}
I can import the jsTest.js file perfectly. But when I try to do the same for awsSdk.js I get the following error:
QQmlApplicationEngine failed to load component
qrc:/main.qml:8 Script qrc:/awsSdk.js unavailable
qrc:/awsSdk.js:6023 Expected token `identifier'
Source Code for jsTest.js:
// jsTest.js
var x=0;
function jsTest()
{
x++;
return "Counter : "+x+"";
}
Have I missed something? Do you have another suggestion for I to upload a file to AWS S3 from a Qt Project using only QML/Javascript?