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
qquickfiledialogimpl_p_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 QQUICKFILEDIALOG_P_P_H
6#define QQUICKFILEDIALOG_P_P_H
7
8//
9// W A R N I N G
10// -------------
11//
12// This file is not part of the Qt API. It exists purely as an
13// implementation detail. This header file may change from version to
14// version without notice, or even be removed.
15//
16// We mean it.
17//
18
19#include <QtQuickTemplates2/private/qquickcombobox_p.h>
20#include <QtQuickTemplates2/private/qquickdialog_p_p.h>
21#include <QtQuickTemplates2/private/qquickdialogbuttonbox_p.h>
22#include <QtQuickTemplates2/private/qquicklabel_p.h>
23#include <QtQuickTemplates2/private/qquicktextfield_p.h>
24
26
27#include <QtCore/qpointer.h>
28
30
31class QQuickFileNameFilter;
32
33class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickFileDialogImplPrivate : public QQuickDialogPrivate
34{
35public:
36 Q_DECLARE_PUBLIC(QQuickFileDialogImpl)
37
38 QQuickFileDialogImplPrivate();
39
40 static QQuickFileDialogImplPrivate *get(QQuickFileDialogImpl *dialog)
41 {
42 return dialog->d_func();
43 }
44
45 QQuickFileDialogImplAttached *attachedOrWarn();
46
47 void setNameFilters(const QStringList &filters);
48
49 void updateEnabled();
50 void updateSelectedFile(const QString &oldFolderPath);
51 void updateFileNameTextEdit();
52 static QDir::SortFlags fileListSortFlags();
53 static QFileInfoList fileList(const QDir &dir);
54 void setFileDialogListViewCurrentIndex(int newCurrentIndex);
55 void tryUpdateFileDialogListViewCurrentIndex(int newCurrentIndex);
56 void fileDialogListViewCountChanged();
57
58 void handleAccept() override;
59 void handleClick(QQuickAbstractButton *button) override;
60 void selectFile();
61
62 QSharedPointer<QFileDialogOptions> options;
63 QUrl currentFolder;
64 QUrl selectedFile;
65 QQuickAbstractButton *lastButtonClicked = nullptr;
66 QStringList nameFilters;
67 mutable QQuickFileNameFilter *selectedNameFilter = nullptr;
68 QString acceptLabel;
69 QString rejectLabel;
70 bool setCurrentIndexToInitiallySelectedFile = false;
71 QFileInfoList cachedFileList;
72 int pendingCurrentIndexToSet = -1;
73};
74
76{
77 void nameFiltersComboBoxItemActivated(int index);
78 void fileDialogListViewCurrentIndexChanged();
79 void fileNameEditedByUser();
80 void fileNameEditingByUserFinished();
81
82public:
83 Q_DECLARE_PUBLIC(QQuickFileDialogImplAttached)
84
93};
94
95QT_END_NAMESPACE
96
97#endif // QQUICKFILEDIALOG_P_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)