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_ADDED_IN_VERSION(1, 0)
32 QML_EXTENDED_NAMESPACE(QFileDialogOptions)
33 Q_PROPERTY(QUrl folder READ folder WRITE setFolder NOTIFY folderChanged FINAL)
34 Q_PROPERTY(QUrl currentFolder READ currentFolder WRITE setCurrentFolder NOTIFY currentFolderChanged FINAL)
35 Q_PROPERTY(QFileDialogOptions::FileDialogOptions options READ options WRITE setOptions RESET resetOptions NOTIFY optionsChanged FINAL)
36 Q_PROPERTY(QString acceptLabel READ acceptLabel WRITE setAcceptLabel RESET resetAcceptLabel NOTIFY acceptLabelChanged FINAL)
37 Q_PROPERTY(QString rejectLabel READ rejectLabel WRITE setRejectLabel RESET resetRejectLabel NOTIFY rejectLabelChanged FINAL)
38
39public:
40 explicit QQuickLabsPlatformFolderDialog(QObject *parent = nullptr);
41
42 QUrl folder() const;
43 void setFolder(const QUrl &folder);
44
45 QUrl currentFolder() const;
46 void setCurrentFolder(const QUrl &folder);
47
48 QFileDialogOptions::FileDialogOptions options() const;
49 void setOptions(QFileDialogOptions::FileDialogOptions options);
50 void resetOptions();
51
52 QString acceptLabel() const;
53 void setAcceptLabel(const QString &label);
54 void resetAcceptLabel();
55
56 QString rejectLabel() const;
57 void setRejectLabel(const QString &label);
58 void resetRejectLabel();
59
60Q_SIGNALS:
61 void folderChanged();
62 void currentFolderChanged();
63 void optionsChanged();
64 void acceptLabelChanged();
65 void rejectLabelChanged();
66
67protected:
68 bool useNativeDialog() const override;
69 void onCreate(QPlatformDialogHelper *dialog) override;
70 void onShow(QPlatformDialogHelper *dialog) override;
71 void accept() override;
72
73private:
74 QUrl m_folder;
75 QSharedPointer<QFileDialogOptions> m_options;
76};
77
78QT_END_NAMESPACE
79
80#endif // QT_DEPRECATED_SINCE(6, 9)
81
82#endif // QQUICKLABSPLATFORMFOLDERDIALOG_P_H