[Interest] Qt 5 and filesystem

Bo Thorsen bo at fioniasoftware.dk
Fri Jan 4 07:52:10 CET 2013


??????? ?????? is correct. You have to write C++ for this. The reason is 
that there is no javascript framework available to you, and JS as a 
language is almost completely stripped of features.

In your case, you are trying to do stuff with files. That's one case 
where you are going to be disappointed. There is no file handling 
available in QML/JS at all. Yes, there are a few models available (like 
FolderListModel), but simple file handling isn't there.

The dialogs can't be moved to QtGui because there are implementations 
that use the Qt widgets. Not all systems provide a file dialog that Qt 
can use.

You could find a javascript framework and use this instead. But it's 
probably easier for you to write and deploy C++ based Qt code. Make a 
simple class and export what you need to QML with it.

Bo.

Den 03-01-2013 22:39, ??????? ?????? skrev:
> Most likely, you'll have to write on C++ your component. You also can 
> use FolderListModel (http://doc.qt.digia.com/qt/qml-folderlistmodel.html).
>
> For example, for my needs I made this:
> http://pastebin.com/??BSPF3sBw <http://pastebin.com/BSPF3sBw>
> http://pastebin.com/sxw??Cb3e5 <http://pastebin.com/sxwCb3e5>
>
>
> ???????, 3 ?????? 2013, 21:54 +01:00 ?? Stéphane Fabry <sf at xris.eu>:
>
>     Hello,
>
>     Let's say I'd like to make a desktop application with Qt5 and
>     QtQuick2, the new era :)
>
>     How can I simply prompt a file dialog, or display in my QML
>     filesystem entries ?
>     Both QFileDialog and QFileSystemModel are still in QtWidget module :(
>     I think they should go in QtGui.
>
>     -- 
>     *Stéphane Fabry*
>
>     _______________________________________________
>     Interest mailing list
>     Interest at qt-project.org
>     http://lists.qt-project.org??/mailman/listinfo/interest
>     <http://lists.qt-project.org/mailman/listinfo/interest>
>
>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest


Bo Thorsen.

-- 
Fionia Software - Qt experts for hire.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130104/450e493f/attachment.html>


More information about the Interest mailing list