[Development] File chooser dialog as a Qt Component - API design

morten.sorvig at nokia.com morten.sorvig at nokia.com
Wed May 2 13:55:02 CEST 2012

On Apr 28, 2012, at 12:25 PM, ext Alberto Mardegan wrote:

> Hi all!
>  I really miss a QML version of QFileDialog. There currently isn't a Qt
> Component for choosing a file or a directory from the filesystem, and I
> think we should fill this gap ASAP. There's a bug I created to keep
> track of this:
>  https://bugreports.qt-project.org/browse/QTCOMPONENTS-1242
> Now I'd like to start discussing the API design for such a component, so
> I've added a comment to that bug with a proposal.
> I would appreciate if you have a look at it, and tell me if it's sane. :-)
> I'm working on a MeeGo implementation of it right now, but I will also
> need a desktop version eventually.

Some thoughts on desktop version: We have QPA classes for accessing the native dialogs. The classes are QPlatformFileDialogHelper and QFileDialogOptions. The helper object is accessible through  QGuiApplicationPrivate::platformTheme()->createPlatformDialogHelper() which will return non-null if the current platform has a native dialog integration. 

The API seems to map well to the one proposed in QTCOMPONENTS-1242.

If (desktop)Qt needs to draw the dialog, then I think reusing QFileDialog from QtWidgets is a good initial solution. If the app is using desktop components it will already have the QtWidgets dependency.


More information about the Development mailing list