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);
61 FileMode fileMode()
const;
62 void setFileMode(FileMode fileMode);
64 QUrl selectedFile()
const;
65 void setSelectedFile(
const QUrl &selectedFile);
67 QList<QUrl> selectedFiles()
const;
69 QUrl currentFile()
const;
70 void setCurrentFile(
const QUrl &file);
72 QList<QUrl> currentFiles()
const;
73 void setCurrentFiles(
const QList<QUrl> ¤tFiles);
75 QUrl currentFolder()
const;
76 void setCurrentFolder(
const QUrl ¤tFolder);
78 QFileDialogOptions::FileDialogOptions options()
const;
79 void setOptions(QFileDialogOptions::FileDialogOptions options);
82 QStringList nameFilters()
const;
83 void setNameFilters(
const QStringList &filters);
84 void resetNameFilters();
86 QQuickFileNameFilter *selectedNameFilter()
const;
88 QString defaultSuffix()
const;
89 void setDefaultSuffix(
const QString &suffix);
90 void resetDefaultSuffix();
92 QString acceptLabel()
const;
93 void setAcceptLabel(
const QString &label);
94 void resetAcceptLabel();
96 QString rejectLabel()
const;
97 void setRejectLabel(
const QString &label);
98 void resetRejectLabel();
101 void fileModeChanged();
102 void selectedFileChanged();
103 void selectedFilesChanged();
104 void currentFileChanged();
105 void currentFilesChanged();
106 void currentFolderChanged();
107 void optionsChanged();
108 void nameFiltersChanged();
109 void defaultSuffixChanged();
110 void acceptLabelChanged();
111 void rejectLabelChanged();
114 bool useNativeDialog()
const override;
115 void onCreate(QPlatformDialogHelper *dialog) override;
116 void onShow(QPlatformDialogHelper *dialog) override;
117 void onHide(QPlatformDialogHelper *dialog) override;
118 void accept() override;
121 QUrl addDefaultSuffix(
const QUrl &file)
const;
122 QList<QUrl> addDefaultSuffixes(
const QList<QUrl> &files)
const;
124 void setSelectedFiles(
const QList<QUrl> &selectedFiles);
127 QList<QUrl> m_selectedFiles;
128 QSharedPointer<QFileDialogOptions> m_options;
129 mutable QQuickFileNameFilter *m_selectedNameFilter;