1 | // Copyright (C) 2021 The Qt Company Ltd. |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QQUICKFILEDIALOGDELEGATE_P_H |
5 | #define QQUICKFILEDIALOGDELEGATE_P_H |
6 | |
7 | // |
8 | // W A R N I N G |
9 | // ------------- |
10 | // |
11 | // This file is not part of the Qt API. It exists purely as an |
12 | // implementation detail. This header file may change from version to |
13 | // version without notice, or even be removed. |
14 | // |
15 | // We mean it. |
16 | // |
17 | |
18 | #include <QtQuickTemplates2/private/qquickitemdelegate_p.h> |
19 | |
20 | #include "qtquickdialogs2quickimplglobal_p.h" |
21 | |
22 | QT_BEGIN_NAMESPACE |
23 | |
24 | class QQuickDialog; |
25 | class QQuickFileDialogDelegatePrivate; |
26 | |
27 | class Q_QUICKDIALOGS2QUICKIMPL_PRIVATE_EXPORT QQuickFileDialogDelegate : public QQuickItemDelegate |
28 | { |
29 | Q_OBJECT |
30 | Q_PROPERTY(QQuickDialog *dialog READ dialog WRITE setDialog NOTIFY dialogChanged) |
31 | Q_PROPERTY(QUrl file READ file WRITE setFile NOTIFY fileChanged) |
32 | QML_NAMED_ELEMENT(FileDialogDelegate) |
33 | QML_ADDED_IN_VERSION(6, 2) |
34 | |
35 | public: |
36 | explicit QQuickFileDialogDelegate(QQuickItem *parent = nullptr); |
37 | |
38 | QQuickDialog *dialog() const; |
39 | void setDialog(QQuickDialog *dialog); |
40 | |
41 | QUrl file() const; |
42 | void setFile(const QUrl &file); |
43 | |
44 | Q_SIGNALS: |
45 | void dialogChanged(); |
46 | void fileChanged(); |
47 | |
48 | protected: |
49 | void keyReleaseEvent(QKeyEvent *event) override; |
50 | |
51 | private: |
52 | Q_DISABLE_COPY(QQuickFileDialogDelegate) |
53 | Q_DECLARE_PRIVATE(QQuickFileDialogDelegate) |
54 | }; |
55 | |
56 | QT_END_NAMESPACE |
57 | |
58 | QML_DECLARE_TYPE(QQuickFileDialogDelegate) |
59 | |
60 | #endif // QQUICKFILEDIALOGDELEGATE_P_H |
61 | |