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
qquickfolderdialogimpl_p.h
Go to the documentation of this file.
1// Copyright (C) 2021 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 QQUICKFOLDERDIALOGIMPL_P_H
6#define QQUICKFOLDERDIALOGIMPL_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
19#include <QtQuick/private/qquicklistview_p.h>
20#include <QtQuickTemplates2/private/qquickdialog_p.h>
21
23
25
26class QQuickDialogButtonBox;
27
28class QQuickFolderDialogImplAttached;
31class QQuickFolderBreadcrumbBar;
32
33class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickFolderDialogImpl : public QQuickDialog
34{
35 Q_OBJECT
36 Q_PROPERTY(QUrl currentFolder READ currentFolder WRITE setCurrentFolder NOTIFY currentFolderChanged FINAL)
37 Q_PROPERTY(QUrl selectedFolder READ selectedFolder WRITE setSelectedFolder NOTIFY selectedFolderChanged FINAL)
38 QML_NAMED_ELEMENT(FolderDialogImpl)
39 QML_ATTACHED(QQuickFolderDialogImplAttached)
40 QML_ADDED_IN_VERSION(6, 3)
41
42public:
43 explicit QQuickFolderDialogImpl(QObject *parent = nullptr);
44
45 static QQuickFolderDialogImplAttached *qmlAttachedProperties(QObject *object);
46
47 QUrl currentFolder() const;
48 void setCurrentFolder(const QUrl &folder);
49
50 QUrl selectedFolder() const;
51 void setSelectedFolder(const QUrl &selectedFolder);
52
53 QSharedPointer<QFileDialogOptions> options() const;
54 void setOptions(const QSharedPointer<QFileDialogOptions> &options);
55
56 void setAcceptLabel(const QString &label);
57 void setRejectLabel(const QString &label);
58
59Q_SIGNALS:
60 void currentFolderChanged(const QUrl &folderUrl);
61 void selectedFolderChanged(const QUrl &folderUrl);
62 void nameFiltersChanged();
63
64private:
65 void componentComplete() override;
66 void itemChange(QQuickItem::ItemChange change, const QQuickItem::ItemChangeData &data) override;
67
68 Q_DISABLE_COPY(QQuickFolderDialogImpl)
69 Q_DECLARE_PRIVATE(QQuickFolderDialogImpl)
70};
71
72class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickFolderDialogImplAttached : public QObject
73{
74 Q_OBJECT
75 Q_PROPERTY(QQuickListView *folderDialogListView READ folderDialogListView WRITE setFolderDialogListView NOTIFY folderDialogListViewChanged)
76 Q_PROPERTY(QQuickFolderBreadcrumbBar *breadcrumbBar READ breadcrumbBar WRITE setBreadcrumbBar NOTIFY breadcrumbBarChanged)
77 Q_MOC_INCLUDE(<QtQuickTemplates2/private/qquickdialogbuttonbox_p.h>)
78
79public:
80 explicit QQuickFolderDialogImplAttached(QObject *parent = nullptr);
81
82 QQuickListView *folderDialogListView() const;
83 void setFolderDialogListView(QQuickListView *folderDialogListView);
84
85 QQuickFolderBreadcrumbBar *breadcrumbBar() const;
86 void setBreadcrumbBar(QQuickFolderBreadcrumbBar *breadcrumbBar);
87
88Q_SIGNALS:
89 void folderDialogListViewChanged();
90 void breadcrumbBarChanged();
91
92private:
93 Q_DISABLE_COPY(QQuickFolderDialogImplAttached)
94 Q_DECLARE_PRIVATE(QQuickFolderDialogImplAttached)
95};
96
97QT_END_NAMESPACE
98
99#endif // QQUICKFOLDERDIALOGIMPL_P_H
bool acceptKeyClick(Qt::Key key) const override
QPointer< QQuickTextField > fileNameTextField
QPointer< QQuickDialog > overwriteConfirmationDialog
QPointer< QQuickListView > fileDialogListView
QPointer< QQuickFolderBreadcrumbBar > breadcrumbBar
QPointer< QQuickComboBox > nameFiltersComboBox
void handleEventPoint(QPointerEvent *event, QEventPoint &point) override
void handleDrag(QQuickDragEvent *event)
QQuickFileDialogImpl * getFileDialogImpl() const
bool wantsEventPoint(const QPointerEvent *event, const QEventPoint &point) override
Returns true if the given point (as part of event) could be relevant at all to this handler,...
void handleDrop(QQuickDragEvent *event)