Learn what Felgo offers to help your business succeed. Start your free evaluation today! Felgo for Your Business

Forums

OverviewFelgo 4 Support (Qt 6) › Get readdir of documents

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #25506

    nks (baumemo)

    Hi Felgo Team,

    I try to get the readdir of documents. QtCore is not importable so I would like Felgos FileUtils.

    I tried the following:

    fileUtils.getAbsolutePathFromUrlString(fileDialog.selectedFiles)

    but this is the write dir. Am I wrong or is there no read dir helper?

    Regards

    #25507

    Günther
    Felgo Team

    Hi,

    Generally speaking, the Felgo FileUtils read/write functions can operate on any paths. To make working with default paths easier, Qt offers the C++ QStandardPaths class.

    With Felgo FileUtils, you can use these paths from QML. E.g. to get a path to a file in the Documents location you can use FileUtils.storageLocation(FileUtils.DocumentsLocation, "fileName")

    The queried paths refer to the QStandardPaths::writableLocation. As an alternative, you can also try the Qt QML StandardPaths feature: https://doc.qt.io/qt-6/qml-qt-labs-platform-standardpaths.html

    Using import QtCore you can e.g. get the Documents folder like this:
    property url documentsFolder: StandardPaths.writableLocation(StandardPaths.DocumentsLocation)

    Best,
    Günther

Viewing 2 posts - 1 through 2 (of 2 total)

RSS feed for this thread

You must be logged in to reply to this topic.

Qt_Technology_Partner_RGB_475 Qt_Service_Partner_RGB_475_padded