[Android-development] Android QFileDialog

Rutledge Shawn Shawn.Rutledge at theqtcompany.com
Mon Feb 16 11:42:24 CET 2015


On 16 Feb 2015, at 10:57, <maitai at virtual-winds.org> <maitai at virtual-winds.org> wrote:

> Yes we've discussed that some time ago already
> 
> I've tried hard with qtquick.dialogs, and finally got it more or less 
> working. The big problem being that it's bugged too (something to do 
> with the save function as well if I remember), and more importantly you 
> cannot display a qml window on top of a widget-based application 
> (qmainwindow) because qt can manage only one surface at a time, so I had 
> to hide my mainwindow while qtquick/filedialog was running etc... to 
> make it short it was a mess :)
> 
> The pure QWidget-based with QFileSystemModel solution is much better and 
> faster in our case.

OK I suspected that.  You are running into the problem that Android apps can’t actually have multiple windows, and our solution to fake it is different between QtQuick and widgets.  Widgets are rendered with the raster engine, so it’s possible to composite multiple widget-based windows in software; whereas QtQuick needs to own the full screen, because of the OpenGL rendering, and dialog windows are simulated by putting them into the same scene.

I think we should make QFileDialog more touch-friendly at some point.  It seems to me the main problem is that it prefers to do drag-and-drop instead of flicking in the list view, right?  (And there are also some appearance and sizing issues, which are easier to fix.)  And yet DnD should also be possible in general (especially on desktop systems).  So we are thinking now that the distinction should be that when you flick quickly, it should scroll, whereas if you want to do DnD you would need to press, pause for a short time and then drag.  (But pause for a shorter time than you would for a “long press”.)  Or otherwise, the solution should probably be the same as for text selection in a scrollable text editor: somehow you have to be able to use one finger both to select a range of text, and also to scroll.

> Le 16-02-2015 10:42, Rutledge Shawn a écrit :
>> You could use QtQuick.Dialogs.  The implementation for Android is QML
>> and uses FolderListModel to access the directory structure.  You can
>> also modify DefaultFileDialog.qml to customize it for special needs.
>> But I see that we discussed it last June.
>> 
>> Are you mixing widgets and QtQuick?
>> 
>> On 16 Feb 2015, at 10:32, <maitai at virtual-winds.org>
>> <maitai at virtual-winds.org> wrote:
>> 
>>> Hello,
>>> 
>>> We based it on QFileSystemModel and QModelIndex. You can easily find
>>> some examples on internet and adapt it to Android. It's called the 
>>> same
>>> way QFileDialog is, so it's just a #ifdef in case our app is running
>>> under android (Widget based, no qml).
>>> 
>>> Philippe Lelong.
>>> 
>>> 
>>> Le 16-02-2015 10:16, Robert Iakobashvili a écrit :
>>>> On Fri, Feb 13, 2015 at 7:09 PM,  <maitai at virtual-winds.org> wrote:
>>>>> Hello,
>>>>> 
>>>>> I don't have such problem because we are using our own fileDialog 
>>>>> and
>>>>> colorDialog for Android (anyway QFileDialog, QFontDialog and
>>>>> QColorDialog
>>>>> are not usable at all on Android).
>>>> 
>>>>> Thanks
>>>>> Philippe Lelong
>>>>> 
>>>> 
>>>> Changed the subject in order not to hay-jack
>>>> the original conversation to another direction.
>>>> 
>>>> Could you provide some tips regarding your
>>>> custom-made android file dialog?
>>>> 
>>>> Have you made your own widget or a native dialog
>>>> above the Qt infra?
>>>> 
>>>> My understanding is that writable locations to
>>>> be detected: the internal, the Downloads and the sdcard,
>>>> if any, and presented as folder options.
>>>> 
>>>> Any tips or directions would be very much
>>>> appreciated.
>>>> 
>>>> Thank you in advance.
>>>> Robert
>>>> _______________________________________________
>>>> Android-development mailing list
>>>> Android-development at qt-project.org
>>>> http://lists.qt-project.org/mailman/listinfo/android-development
>>> _______________________________________________
>>> Android-development mailing list
>>> Android-development at qt-project.org
>>> http://lists.qt-project.org/mailman/listinfo/android-development
> _______________________________________________
> Android-development mailing list
> Android-development at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/android-development




More information about the Android-development mailing list