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
qquicksidebar_p_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 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 QQUICKSIDEBAR_P_P_H
6#define QQUICKSIDEBAR_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 <QtCore/qstandardpaths.h>
21#include <QtQuickTemplates2/private/qquickmenu_p.h>
22
24
25class QQuickContextMenu;
26
27class Q_QUICKDIALOGS2QUICKIMPL_EXPORT QQuickSideBarPrivate : public QQuickContainerPrivate
28{
29public:
30 Q_DECLARE_PUBLIC(QQuickSideBar)
31
32 static QQuickSideBarPrivate *get(QQuickSideBar *sidebar)
33 {
34 return sidebar->d_func();
35 }
36
37 QQuickItem *createDelegateItem(QQmlComponent *component, const QVariantMap &initialProperties);
38 void repopulate();
39 void buttonClicked();
40
41 QUrl dialogFolder() const;
42 void setDialogFolder(const QUrl &folder);
43 QString displayNameFromFolderPath(const QString &filePath);
44 QUrl folderIconSource() const;
45 QUrl folderIconSource(QStandardPaths::StandardLocation stdLocation) const;
46 QSize dialogIconSize() const;
47 void folderChanged();
48
49 void readSettings();
50 void writeSettings() const;
51
52 void addFavorite(const QUrl &favorite);
53 void removeFavorite(const QUrl &favorite);
54 bool showAddFavoriteDelegate() const;
55 void setShowAddFavoriteDelegate(bool show);
56 bool addFavoriteDelegateHovered() const;
57 void setAddFavoriteDelegateHovered(bool hovered);
58 QUrl addFavoriteIconUrl() const;
59
60 void initContextMenu();
61 void handleContextMenuRequested(QPointF pos);
62 void handleRemoveAction();
63
64protected:
65 qreal getContentWidth() const override;
66 qreal getContentHeight() const override;
67 void itemGeometryChanged(QQuickItem *item, QQuickGeometryChange change, const QRectF &diff) override;
68 void itemImplicitWidthChanged(QQuickItem *item) override;
69 void itemImplicitHeightChanged(QQuickItem *item) override;
70
71
72private:
73 QQuickDialog *dialog = nullptr;
74 QQmlComponent *buttonDelegate = nullptr;
75 QQmlComponent *separatorDelegate = nullptr;
76 QQmlComponent *addFavoriteDelegate = nullptr;
77 QQuickContextMenu *contextMenu = nullptr;
78 QQuickMenu *menu = nullptr;
79 QQuickAction *removeAction = nullptr;
80 QUrl urlToBeRemoved;
81 QList<QStandardPaths::StandardLocation> folderPaths;
82 QList<QUrl> favoritePaths;
83 QUrl currentButtonClickedUrl;
84 qreal addFavoriteButtonImplicitSize = 0;
85 qreal separatorImplicitSize = 0;
86 bool folderPathsValid = false;
87 bool favoritePathsValid = false;
88 bool repopulating = false;
89 bool addFavoriteDelegateVisible = false;
90 bool addFavoriteHovered = false;
91 bool showSeparator = false;
92};
93
94QT_END_NAMESPACE
95
96#endif // QQUICKSIDEBAR_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)