File Handling in QML
situ117 last edited by
thisisbhaskar last edited by
L.MCH last edited by
You just have to code a QDeclarativeItem subclass in C++ with the methods (and the internal state information like current directory, etc.) you need and register it at runtime so it becomes accessible as a QML Element as described here:
Better if you define a QDeclarativeItem subclass that performs the file handling operations including most of the complex stuff and then emits a signal when done or exposes a QML ListModel with the result of the operations performed.
For example, when you change the source property in the QML Image element , the element performs lots of file operations and data conversions, but on the UI side you just get onStatusChanged signals and the UI perform a refresh of the image.