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
qcocoafiledialoghelper.h
Go to the documentation of this file.
1// Copyright (C) 2016 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 QCOCOAFILEDIALOGHELPER_H
6#define QCOCOAFILEDIALOGHELPER_H
7
8#include <QObject>
9#include <qpa/qplatformdialoghelper.h>
10#include <QtCore/private/qcore_mac_p.h>
11
12QT_DECLARE_NAMESPACED_OBJC_INTERFACE(QNSOpenSavePanelDelegate, NSObject<NSOpenSavePanelDelegate>)
13
14QT_BEGIN_NAMESPACE
15
16class QEventLoop;
17class QFileDialog;
18class QFileDialogPrivate;
19
21{
22public:
24 virtual ~QCocoaFileDialogHelper();
25
26 void exec() override;
27
29
30 bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override;
31 void hide() override;
32 void setDirectory(const QUrl &directory) override;
33 QUrl directory() const override;
34 void selectFile(const QUrl &filename) override;
35 QList<QUrl> selectedFiles() const override;
36 void setFilter() override;
37 void selectNameFilter(const QString &filter) override;
38 QString selectedNameFilter() const override;
39
40public: // for QNSOpenSavePanelDelegate
41 void panelClosed(NSInteger result);
42 void panelDirectoryDidChange(NSString *path);
43
44private:
45 void createNSOpenSavePanelDelegate();
46
47 QNSOpenSavePanelDelegate *m_delegate = nil;
48 QUrl m_directory;
49 QEventLoop *m_eventLoop = nullptr;
50};
51
52QT_END_NAMESPACE
53
54#endif // QCOCOAFILEDIALOGHELPER_H
QList< QUrl > selectedFiles() const override
bool defaultNameFilterDisables() const override
QString selectedNameFilter() const override
void panelDirectoryDidChange(NSString *path)
QUrl directory() const override
void setDirectory(const QUrl &directory) override
bool show(Qt::WindowFlags windowFlags, Qt::WindowModality windowModality, QWindow *parent) override
void selectNameFilter(const QString &filter) override
void selectFile(const QUrl &filename) override
void panelClosed(NSInteger result)
QSharedPointer< QFileDialogOptions > SharedPointerFileDialogOptions
static NSString * strippedText(QString s)
static NSOpenPanel * openpanel_cast(NSSavePanel *panel)
QList< QString > QStringList
Constructs a string list that contains the given string, str.