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
22QT_BEGIN_NAMESPACE
23
24class QQuickDialog;
25class QQuickFileDialogDelegatePrivate;
26
27class 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
35public:
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
44Q_SIGNALS:
45 void dialogChanged();
46 void fileChanged();
47
48protected:
49 void keyReleaseEvent(QKeyEvent *event) override;
50
51private:
52 Q_DISABLE_COPY(QQuickFileDialogDelegate)
53 Q_DECLARE_PRIVATE(QQuickFileDialogDelegate)
54};
55
56QT_END_NAMESPACE
57
58QML_DECLARE_TYPE(QQuickFileDialogDelegate)
59
60#endif // QQUICKFILEDIALOGDELEGATE_P_H
61

source code of qtdeclarative/src/quickdialogs/quickdialogsquickimpl/qquickfiledialogdelegate_p.h