2

I am programming in qml for a mobile client. I want to check if a particular folder exists on the mobile device. If not, I want to create it. I am using qml, so solutions can be in qml or JavaScript.

(Note: when I say "JavaScript", people say "use php,ajax etc." but I can only use JavaScript and qml on my mobile platform)

gariepy
  • 3,576
  • 6
  • 21
  • 34
Gürcan Kavakçı
  • 562
  • 1
  • 11
  • 24
  • You can't do this in a raw QML/js application as there is no filesystem support. Is there an underlying Qt runner or are you using the stock QmlViewer? You can certainly implement this functionality in Qt C++ and then expose it to QML. – Stu Mackellar Jul 31 '11 at 10:25
  • ok, how can i do it with Qt c++? at least is there any link to start? – Gürcan Kavakçı Aug 01 '11 at 12:30
  • In 2019's labs at least reading file system access is possible: https://doc.qt.io/qt-5/qml-qt-labs-folderlistmodel-folderlistmodel.html – dreua Jul 08 '19 at 23:14

1 Answers1

1

Do it in Qt (like @Stu-Mackellar already said).

Access Qt methods like this:

http://doc.qt.nokia.com/qt-maemo-4.7/qtbinding.html#calling-c-methods-from-qml

and do the Qt part like described here:

Checking if a folder exists (and creating folders) in Qt, C++

Community
  • 1
  • 1
Marco
  • 2,190
  • 15
  • 22