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
qquicklabsplatformfolderdialog_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 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 QQUICKLABSPLATFORMFOLDERDIALOG_P_H
6#define QQUICKLABSPLATFORMFOLDERDIALOG_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This folder is not part of the Qt API. It exists purely as an
13// implementation detail. This header folder may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
20#include <QtCore/qurl.h>
21#include <QtQml/qqml.h>
22
23#if QT_DEPRECATED_SINCE(6, 9)
24
25QT_BEGIN_NAMESPACE
26
27class QQuickLabsPlatformFolderDialog : public QQuickLabsPlatformDialog
28{
29 Q_OBJECT
30 QML_NAMED_ELEMENT(FolderDialog)
31 QML_EXTENDED_NAMESPACE(QFileDialogOptions)
32 Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged FINAL)
33 Q_PROPERTY(QUrl currentFolder READ currentFolder WRITE setCurrentFolder NOTIFY currentFolderChanged FINAL)
34 Q_PROPERTY(QFileDialogOptions::FileDialogOptions options READ options WRITE setOptions RESET resetOptions NOTIFY optionsChanged FINAL)
35 Q_PROPERTY(QString acceptLabel READ acceptLabel WRITE setAcceptLabel RESET resetAcceptLabel NOTIFY acceptLabelChanged FINAL)
36 Q_PROPERTY(QString rejectLabel READ rejectLabel WRITE setRejectLabel RESET resetRejectLabel NOTIFY rejectLabelChanged FINAL)
37
38public:
39 explicit QQuickLabsPlatformFolderDialog(QObject *parent = nullptr);
40
41 QUrl folder() const;
42 void setFolder(const QUrl &folder);
43
44 QUrl currentFolder() const;
45 void setCurrentFolder(const QUrl &folder);
46
47 QFileDialogOptions::FileDialogOptions options() const;
48 void setOptions(QFileDialogOptions::FileDialogOptions options);
49 void resetOptions();
50
51 QString acceptLabel() const;
52 void setAcceptLabel(const QString &label);
53 void resetAcceptLabel();
54
55 QString rejectLabel() const;
56 void setRejectLabel(const QString &label);
57 void resetRejectLabel();
58
59Q_SIGNALS:
60 void folderChanged();
61 void currentFolderChanged();
62 void optionsChanged();
63 void acceptLabelChanged();
64 void rejectLabelChanged();
65
66protected:
67 bool useNativeDialog() const override;
68 void onCreate(QPlatformDialogHelper *dialog) override;
69 void onShow(QPlatformDialogHelper *dialog) override;
70 void accept() override;
71
72private:
73 QUrl m_folder;
74 QSharedPointer<QFileDialogOptions> m_options;
75};
76
77QT_END_NAMESPACE
78
79#endif // QT_DEPRECATED_SINCE(6, 9)
80
81#endif // QQUICKLABSPLATFORMFOLDERDIALOG_P_H