Filebrowser using QML
-
Please format your code. Will help others to read and understand it better.
-
thanks .I think this post is really help full.
-
Hi,
I'd suggest taking a look at the FolderListModel element if you haven't done so already (http://doc.qt.nokia.com/4.7-snapshot/qml-folderlistmodel.html). You can find an example of its use in the qmlviewer application (the QML files are in the source tree under tools/qml/browser).
In regards to model->setRootPath("/home/user/"), from the documentation it looks like this function only determines what directory is watched by the model for changes, and doesn't impact what is exposed to/shown by the view (rootIndex needs to be set for that).
Regards,
Michael -
I am assuming this is the dialog used on the qmlviewer application when file--> open is selected?
-
[quote author="kyleplattner" date="1296434643"]I am assuming this is the dialog used on the qmlviewer application when file--> open is selected?[/quote]
It depends on the platform as to what qmlviewer shows by default. You can explicitly turn on the QML-based file browser by passing -qmlbrowser to qmlviewer.
Regards,
Michael -
I have actually raised a bug for the issue http://bugreports.qt.nokia.com/browse/QTBUG-17141