So I need to make a directory if it's not exist by using QtObject. This code works fine inside a qml file but I need to create and use this code inside a javaScript file. How to do it?
QtObject {
id: internal
property url folderUrl: "image";
}
FileFolder {
id: fileFolder
url: "assets/media_images"//internal.folderUrl
Component.onCompleted: {
if (!fileFolder.exists) {
fileFolder.makeFolder(internal.folderUrl);
}
}
}