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
qquickfolderbreadcrumbbar_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 QQUICKFOLDERBREADCRUMBBAR_P_P_H
6#define QQUICKFOLDERBREADCRUMBBAR_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/qquickcontainer_p_p.h>
20#include <QtQuickTemplates2/private/qquickdeferredexecute_p_p.h>
21#include <QtQuickTemplates2/private/qquickdialog_p.h>
22
24
25class QQuickAbstractButton;
26class QQuickTextField;
27
28class QQuickFileDialogImpl;
29class QQuickFolderDialogImpl;
30
31class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickFolderBreadcrumbBarPrivate : public QQuickContainerPrivate
32{
33public:
34 Q_DECLARE_PUBLIC(QQuickFolderBreadcrumbBar)
35
36 QQuickItem *createDelegateItem(QQmlComponent *component, const QVariantMap &initialProperties);
37 static QString folderBaseName(const QString &folderPath);
38 static QStringList crumbPathsForFolder(const QUrl &folder);
39 void repopulate();
40 void crumbClicked();
41 void folderChanged();
42
43 void cancelUpButton();
44 void executeUpButton(bool complete = false);
45 void goUp();
46
47 void cancelTextField();
48 void executeTextField(bool complete = false);
49 void toggleTextFieldVisibility();
50 void textFieldAccepted();
51
52 void textFieldVisibleChanged();
53 void textFieldActiveFocusChanged();
54 void handleTextFieldShown();
55 void handleTextFieldHidden();
56 void ungrabEditPathShortcut();
57
58 QQuickFileDialogImpl *asFileDialog() const;
59 QQuickFolderDialogImpl *asFolderDialog() const;
60 bool isFileDialog() const;
61 QUrl dialogFolder() const;
62 void setDialogFolder(const QUrl &folder);
63
64 qreal getContentWidth() const override;
65 qreal getContentHeight() const override;
66 void resizeContent() override;
67
68 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
69 void itemImplicitWidthChanged(QQuickItem *item) override;
70 void itemImplicitHeightChanged(QQuickItem *item) override;
71
72private:
73 QQuickDialog *dialog = nullptr;
74 QList<QString> folderPaths;
75 QQmlComponent *buttonDelegate = nullptr;
76 QQmlComponent *separatorDelegate = nullptr;
77 QQuickDeferredPointer<QQuickAbstractButton> upButton;
78 QQuickDeferredPointer<QQuickTextField> textField;
79 int editPathToggleShortcutId = 0;
80#if QT_CONFIG(shortcut)
81 int goUpShortcutId = 0;
82#endif
83 int upButtonSpacing = 0;
84 bool repopulating = false;
85};
86
87QT_END_NAMESPACE
88
89#endif // QQUICKFOLDERBREADCRUMBBAR_P_P_H
static QString upButtonName()
static QString textFieldName()