9

I'm not sure if it is possible, but currently, when I show an open file dialog:

QString file = QFileDialog::getOpenFileName(this);

The dialog shown is not the native dialog for Android.

Instead, it looks like this (it's also not maximized):

enter image description here

I'm using Qt 5.2.0 for Android.

sashoalm
  • 63,456
  • 96
  • 348
  • 677
  • possible duplicate of [Qt/Necessitas - reasonable QFileDialog replacement/skin?](http://stackoverflow.com/questions/15079406/qt-necessitas-reasonable-qfiledialog-replacement-skin) – Pavel Strakhov Jan 12 '14 at 12:13
  • 1
    I'm using Qt 5.2.0, which is **not Necessitas**, keep in mind. This is an official port, while Necessitas is unofficial, and also an older release. – sashoalm Jan 12 '14 at 12:19
  • @PavelStrakhov: necessitas is qt 4, and the question has the Qt 5 tag as well as the reference to it. – lpapp Jan 12 '14 at 12:20
  • @sashoalm: widgets are ancient, and mostly desktop technology... It is certain that you do not get lotta better user experience out of it. Why not QtQuick2/QtQuickControls or at least the C++ scene graph? – lpapp Jan 12 '14 at 12:21
  • I'll try to see if a Qt Quick project will have a native dialog, maybe that's the reason I don't have a native dialog. – sashoalm Jan 12 '14 at 12:28
  • I couldn't figure out how to show a file dialog in Qt Quick. – sashoalm Jan 12 '14 at 12:33
  • @Laszlo Papp Replacing widgets with graphics view framework is highly questionable. Widgets (and QtQuick) is a general-purpose module, while GVF is convenient only in certain tasks. – Pavel Strakhov Jan 12 '14 at 15:53
  • @PavelStrakhov: you are still confusing Qt 4 with Qt 5. In Qt 5, QtQuick2 is _not_ actually based on QGV. In fact, the whole point was to change that. :) – lpapp Jan 12 '14 at 19:09
  • @PavelStrakhov Btw, can you retract that close vote? It is possible to do it. – sashoalm Jan 12 '14 at 19:12
  • @Laszlo Papp I didn't say anything about QtQuick2 being based on QGV. Actually, this fact doesn't matter for our subject at all. – Pavel Strakhov Jan 13 '14 at 01:00
  • @PavelStrakhov: "Replacing widgets with graphics view framework is highly questionable" -> That was the reply to "Use QML instead of widgets". – lpapp Jan 13 '14 at 04:27

1 Answers1

3

Yes, this is possible in general by using Ministro as a workaround for now.

See the following bugreport for details:

No native controls on Qt 5.2 for Android, not in widgets nor in quick application

The QFileDialog seems to be specified by the QPlatformTheme which is supposed to be implemented.

lpapp
  • 47,035
  • 38
  • 95
  • 127
  • I made the application install Ministro following this answer - http://stackoverflow.com/a/15735878/492336. Unfortunately, installing it did not make the application use the native dialog. – sashoalm Jan 13 '14 at 04:55
  • It seems Ministro does not make the application look native at all, and [one of the comments](https://bugreports.qt-project.org/browse/QTBUG-35081?focusedCommentId=225929&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-225929) in the link you provided suggests it wasn't implemented. OK, well, maybe in the future it will be possible. – sashoalm Jan 13 '14 at 05:14
  • @sashoalm: hmm, you seem to think that QtQuickControls are QtWidgets, whereas they are not. That comment states the future plan of QtQuickControls, however QFileDialog is in QtWidgets. – lpapp Jan 13 '14 at 05:16
  • My application doesn't use Qt Quick, and Ministro still doesn't make it look native, in fact, it screws up the theme so the checkboxes don't show at all (only their text shows). – sashoalm Jan 13 '14 at 05:26
  • I haven't specified a platform theme anywhere, I just set my application to [use Ministro](http://stackoverflow.com/a/15735878/492336). How do I specify a platform theme? – sashoalm Jan 13 '14 at 05:34
  • @sashoalm: just read it this morning, http://www.kdab.com/using-qt-make-native-android-apps/?utm_source=rss&utm_medium=rss&utm_campaign=using-qt-make-native-android-apps – lpapp May 09 '14 at 11:03
  • @lpapp The bug is now closed, would you mind updating the question? – Tomáš Zato - Reinstate Monica Jan 29 '16 at 10:15