Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquickfolderdialog_p.h
Go to the documentation of this file.
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// Qt-Security score:significant reason:default
4
5#ifndef QQUICKFOLDERDIALOG_P_H
6#define QQUICKFOLDERDIALOG_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtCore/qurl.h>
20#include <QtQml/qqml.h>
21
23
25
26class QQuickFileNameFilter;
27
28class Q_QUICKDIALOGS2_EXPORT QQuickFolderDialog : public QQuickAbstractDialog
29{
30 Q_OBJECT
31 Q_PROPERTY(QUrl currentFolder READ currentFolder WRITE setCurrentFolder NOTIFY currentFolderChanged FINAL)
32 Q_PROPERTY(QUrl selectedFolder READ selectedFolder WRITE setSelectedFolder NOTIFY selectedFolderChanged FINAL)
33 Q_PROPERTY(QFileDialogOptions::FileDialogOptions options READ options WRITE setOptions RESET resetOptions NOTIFY optionsChanged FINAL)
34 Q_PROPERTY(QString acceptLabel READ acceptLabel WRITE setAcceptLabel RESET resetAcceptLabel NOTIFY acceptLabelChanged FINAL)
35 Q_PROPERTY(QString rejectLabel READ rejectLabel WRITE setRejectLabel RESET resetRejectLabel NOTIFY rejectLabelChanged FINAL)
36 QML_EXTENDED_NAMESPACE(QFileDialogOptions)
37 QML_NAMED_ELEMENT(FolderDialog)
38 QML_ADDED_IN_VERSION(6, 3)
39
40public:
41 explicit QQuickFolderDialog(QObject *parent = nullptr);
42
43 QUrl currentFolder() const;
44 void setCurrentFolder(const QUrl &folder);
45
46 QUrl selectedFolder() const;
47 void setSelectedFolder(const QUrl &folder);
48
49 QFileDialogOptions::FileDialogOptions options() const;
50 void setOptions(QFileDialogOptions::FileDialogOptions options);
51 void resetOptions();
52
53 QString acceptLabel() const;
54 void setAcceptLabel(const QString &label);
55 void resetAcceptLabel();
56
57 QString rejectLabel() const;
58 void setRejectLabel(const QString &label);
59 void resetRejectLabel();
60
61Q_SIGNALS:
62 void currentFolderChanged();
63 void selectedFolderChanged();
64 void optionsChanged();
65 void acceptLabelChanged();
66 void rejectLabelChanged();
67
68protected:
69 bool useNativeDialog() const override;
70 void onCreate(QPlatformDialogHelper *dialog) override;
71 void onShow(QPlatformDialogHelper *dialog) override;
72
73private:
74 QSharedPointer<QFileDialogOptions> m_options;
75};
76
77QT_END_NAMESPACE
78
79#endif // QQUICKFOLDERDIALOG_P_H