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

Forums

OverviewFelgo SDK Support › Get readdir of documents

Viewing 4 posts - 1 through 4 (of 4 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

    #25519

    nks (baumemo)

    Hi Günther,

    thank you for your feedback.

    I exactly tried what you said before. The problem with QtCore is it is not possible to import it using the default Felgo installation using the LiveClient:
    import QtCore => module “QtCore” is not installed.

    Is this a bug?

    Regards

     

    #25524

    Günther
    Felgo Team

    You are right, the Live Client currently does not import it. In Felgo we use the FileUtils as our customized QML wrapper for file handling, so the QtCore StandardPaths are not necessary.

    Is there a specific feature missing for the Felgo FileUtils compared to the QtCore StandardPaths?

    To use QtCore with Felgo Live, you can optionally add the module to your project and build a custom Live Client preview app that includes all your native C++ code and custom libraries.

Viewing 4 posts - 1 through 4 (of 4 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