Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qandroidplatformfiledialoghelper.h
Go to the documentation of this file.
1// Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB)
2// Copyright (C) 2021 The Qt Company Ltd.
3// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
4
5#ifndef QANDROIDPLATFORMFILEDIALOGHELPER_H
6#define QANDROIDPLATFORMFILEDIALOGHELPER_H
7
8#include <jni.h>
9
10#include <QEventLoop>
11#include <QtCore/QJniObject>
12#include <QtCore/private/qjnihelpers_p.h>
13#include <qpa/qplatformdialoghelper.h>
14
16
18
20{
22
23public:
25
26 void exec() override;
27 bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override;
28 void hide() override;
29
30 QString selectedNameFilter() const override { return QString(); }
31 void selectNameFilter(const QString &) override {}
32 void setFilter() override {}
33 QList<QUrl> selectedFiles() const override { return m_selectedFile; }
34 void selectFile(const QUrl &) override {}
35 QUrl directory() const override { return m_directory; }
36 void setDirectory(const QUrl &directory) override;
37 bool defaultNameFilterDisables() const override { return false; }
38 bool handleActivityResult(jint requestCode, jint resultCode, jobject data) override;
39
40private:
41 QJniObject getFileDialogIntent(const QString &intentType);
42 void takePersistableUriPermission(const QJniObject &uri);
43 void setInitialFileName(const QString &title);
44 void setInitialDirectoryUri(const QString &directory);
45 void setOpenableCategory();
46 void setAllowMultipleSelections(bool allowMultiple);
47 void setMimeTypes();
48
49 QEventLoop m_eventLoop;
50 QList<QUrl> m_selectedFile;
51 QUrl m_directory;
52 QJniObject m_intent;
53 const QJniObject m_activity;
54};
55
56}
58
59#endif // QANDROIDPLATFORMFILEDIALOGHELPER_H
\inmodule QtCore
Definition qeventloop.h:16
\inmodule QtCore
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
The QPlatformFileDialogHelper class allows for platform-specific customization of file dialogs.
\macro QT_RESTRICTED_CAST_FROM_ASCII
Definition qstring.h:129
\inmodule QtCore
Definition qurl.h:94
\inmodule QtGui
Definition qwindow.h:63
bool handleActivityResult(jint requestCode, jint resultCode, jobject data) override
Combined button and popup list for selecting options.
WindowModality
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
#define Q_OBJECT
view show()
[18] //! [19]
QString title
[35]