Qt 6.x
The Qt SDK
Loading...
Searching...
No Matches
qandroidplatformdialoghelpers.h
Go to the documentation of this file.
1// Copyright (C) 2013 BogDan Vatra <bogdan@kde.org>
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 QANDROIDPLATFORMDIALOGHELPERS_H
6#define QANDROIDPLATFORMDIALOGHELPERS_H
7
8#include <jni.h>
9
10#include <QEventLoop>
11#include <QtCore/QJniEnvironment>
12#include <QtCore/QJniObject>
13#include <qpa/qplatformdialoghelper.h>
14
16
17namespace QtAndroidDialogHelpers {
18
20{
22public:
25
26 void exec() override;
27 bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality,
28 QWindow *parent) override;
29 void hide() override;
30
31public slots:
32 void dialogResult(int buttonID);
33
34private:
36
37private:
38 bool m_shown = false;
39 QEventLoop m_loop;
40 QJniObject m_javaMessageDialog;
41};
42
43
44bool registerNatives(JNIEnv *env);
45
46}
47
49
50#endif // QANDROIDPLATFORMDIALOGHELPERS_H
\inmodule QtCore
Definition qeventloop.h:16
\inmodule QtCore
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:311
The QPlatformMessageDialogHelper class allows for platform-specific customization of Message dialogs.
\inmodule QtCore
\inmodule QtGui
Definition qwindow.h:63
QStyleOptionButton opt
static bool registerNatives()
Combined button and popup list for selecting options.
WindowModality
#define Q_OBJECT
#define slots
view show()
[18] //! [19]