31 Q_PROPERTY(FileMode fileMode READ fileMode WRITE setFileMode NOTIFY fileModeChanged FINAL)
32 Q_PROPERTY(QUrl selectedFile READ selectedFile WRITE setSelectedFile NOTIFY selectedFileChanged FINAL)
33 Q_PROPERTY(QList<QUrl> selectedFiles READ selectedFiles NOTIFY selectedFilesChanged FINAL)
34 Q_PROPERTY(QUrl currentFile READ currentFile WRITE setCurrentFile NOTIFY currentFileChanged FINAL)
35 Q_PROPERTY(QList<QUrl> currentFiles READ currentFiles WRITE setCurrentFiles NOTIFY currentFilesChanged FINAL)
36 Q_PROPERTY(QUrl currentFolder READ currentFolder WRITE setCurrentFolder NOTIFY currentFolderChanged FINAL)
37 Q_PROPERTY(QFileDialogOptions::FileDialogOptions options READ options WRITE setOptions RESET resetOptions NOTIFY optionsChanged FINAL)
38 Q_PROPERTY(QStringList nameFilters READ nameFilters WRITE setNameFilters RESET resetNameFilters NOTIFY nameFiltersChanged FINAL)
39 Q_PROPERTY(QQuickFileNameFilter *selectedNameFilter READ selectedNameFilter CONSTANT)
40 Q_PROPERTY(QString defaultSuffix READ defaultSuffix WRITE setDefaultSuffix RESET resetDefaultSuffix NOTIFY defaultSuffixChanged FINAL)
41 Q_PROPERTY(QString acceptLabel READ acceptLabel WRITE setAcceptLabel RESET resetAcceptLabel NOTIFY acceptLabelChanged FINAL)
42 Q_PROPERTY(QString rejectLabel READ rejectLabel WRITE setRejectLabel RESET resetRejectLabel NOTIFY rejectLabelChanged FINAL)
43 QML_NAMED_ELEMENT(FileDialog)
44 QML_EXTENDED_NAMESPACE(QFileDialogOptions)
45 QML_ADDED_IN_VERSION(6, 2)
46 Q_MOC_INCLUDE(<QtQuickDialogs2Utils/
private/qquickfilenamefilter_p.h>)
49 explicit QQuickFileDialog(QObject *parent =
nullptr);
58 FileMode fileMode()
const;
59 void setFileMode(FileMode fileMode);
61 QUrl selectedFile()
const;
62 void setSelectedFile(
const QUrl &selectedFile);
64 QList<QUrl> selectedFiles()
const;
66 QUrl currentFile()
const;
67 void setCurrentFile(
const QUrl &file);
69 QList<QUrl> currentFiles()
const;
70 void setCurrentFiles(
const QList<QUrl> ¤tFiles);
72 QUrl currentFolder()
const;
73 void setCurrentFolder(
const QUrl ¤tFolder);
75 QFileDialogOptions::FileDialogOptions options()
const;
76 void setOptions(QFileDialogOptions::FileDialogOptions options);
79 QStringList nameFilters()
const;
80 void setNameFilters(
const QStringList &filters);
81 void resetNameFilters();
83 QQuickFileNameFilter *selectedNameFilter()
const;
85 QString defaultSuffix()
const;
86 void setDefaultSuffix(
const QString &suffix);
87 void resetDefaultSuffix();
89 QString acceptLabel()
const;
90 void setAcceptLabel(
const QString &label);
91 void resetAcceptLabel();
93 QString rejectLabel()
const;
94 void setRejectLabel(
const QString &label);
95 void resetRejectLabel();
98 void fileModeChanged();
99 void selectedFileChanged();
100 void selectedFilesChanged();
101 void currentFileChanged();
102 void currentFilesChanged();
103 void currentFolderChanged();
104 void optionsChanged();
105 void nameFiltersChanged();
106 void defaultSuffixChanged();
107 void acceptLabelChanged();
108 void rejectLabelChanged();
111 bool useNativeDialog()
const override;
112 void onCreate(QPlatformDialogHelper *dialog) override;
113 void onShow(QPlatformDialogHelper *dialog) override;
114 void onHide(QPlatformDialogHelper *dialog) override;
115 void accept() override;
118 QUrl addDefaultSuffix(
const QUrl &file)
const;
119 QList<QUrl> addDefaultSuffixes(
const QList<QUrl> &files)
const;
121 void setSelectedFiles(
const QList<QUrl> &selectedFiles);
124 QList<QUrl> m_selectedFiles;
125 QSharedPointer<QFileDialogOptions> m_options;
126 mutable QQuickFileNameFilter *m_selectedNameFilter;