Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    QFile and QDir equivalent in QML

    QML and Qt Quick
    2
    4
    6007
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      moo1 last edited by

      Is there any specific reason those don't exist?

      1 Reply Last reply Reply Quote 0
      • B
        blam last edited by

        QFile support seems unlikely since file reading/writing would be most efficiently done in C++.

        In terms of support for reading the contents of directories, currently there is "FolderListModel":http://doc.qt.nokia.com/4.7-snapshot/src-imports-folderlistmodel.htmlFolderListModel (part of the experimental Qt.labs.folderlistmodel module) which can be used to display directory listings. This has also been discussed here: http://developer.qt.nokia.com/forums/viewthread/3460/

        1 Reply Last reply Reply Quote 0
        • M
          moo1 last edited by

          Thanks for the link. that's useful for some cases.

          So, maybe not exact exposure of QFile to QML, but how about more high level file access?

          It's perhaps right that C++ is more efficient, but to me it doesn't necessarily justify not to have any kind of local file access API in QML. Also, if efficiency is important I probably use some database system instead of raw file system.

          1 Reply Last reply Reply Quote 0
          • B
            blam last edited by

            Yes, maybe some sort of high level file access would be useful. What sort of access are you thinking about? Things like getting the file name and permissions for a file?

            (Also, if you have some concrete ideas in mind it might be useful to file a suggestion at bugreports.qt.nokia.com so that they can be considered for future API additions.)

            1 Reply Last reply Reply Quote 0
            • First post
              Last post