This qmldir file and the compiled plugin will be installed in $QTDIR/imports/Qt/labs/folderlistmodel/ where the QML engine will find it (since $QTDIR/imports is the value of QLibraryInf::libraryPath()).

Implementing the Model

We'll not discuss the model implementation in detail, as it is not specific to QML - any Qt C++ model can be interfaced to QML. This implementation is basically just takes the krufty old QDirModel, which is a tree with lots of detailed roles and re-presents it as a simpler list model where each item is just a fileName and a filePath (as a file: URL rather than a plain file, since QML works with URLs for all content).