Problem with import Javascript
Solved
QML and Qt Quick
-
hi!
i have a problem with javascript.
i created a Qt Quick Controls Application, and than i have created a script.js with qctreator.
this file was automatically created in Other files directory.on my main.qml i have added this line:
import QtQuick 2.6 import QtQuick.Controls 1.5 import QtQuick.Dialogs 1.2 import "script.js" as Script
and this is the error:
QQmlApplicationEngine failed to load component qrc:/main.qml:4 Script qrc:/script.js unavailable qrc:/script.js:-1 File not found The program has unexpectedly finished.
where am I doing wrong ?
-
Hi,
Do you have a .qrc file in your project ? Does it include script.js ?