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
qquickfiledialogdelegate_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 QQUICKFILEDIALOGDELEGATE_P_P_H
6#define QQUICKFILEDIALOGDELEGATE_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
23#include <QtQuick/private/qquicksinglepointhandler_p.h>
24#include <QtQuick/private/qquicktaphandler_p.h>
25#include <QtQuick/private/qquickdroparea_p.h>
26#include <QtQuickTemplates2/private/qquickitemdelegate_p_p.h>
27#include <QtGui/qdrag.h>
28
30
32{
34
35public:
37
38 enum State {
39 Listening, // the pointer is not being pressed
40 Tracking, // the pointer is being pressed
41 DraggingStarted, // dragging started
42 Dragging, // a drag is ongoing
43 DraggingFinished // dragging finished
44 };
45
46 State state() { return m_state; }
47
49 void grabFolder();
51
52 void handleDrag(QQuickDragEvent *event);
53 void handleDrop(QQuickDragEvent *event);
55
57
58protected:
59 void handleEventPoint(QPointerEvent *event, QEventPoint &point) override;
60 bool wantsEventPoint(const QPointerEvent *event, const QEventPoint &point) override;
61
62private:
63 void resetDragData();
64
65 QPointer<QDrag> m_drag;
66 QPointer<QQuickDropArea> m_dropArea;
67 State m_state = Listening;
68 QUrl m_sourceUrl;
69 bool m_longPressed = false;
70};
71
73{
74public:
75 Q_DECLARE_PUBLIC(QQuickFileDialogDelegate)
76
81
82 void highlightFile();
83 void chooseFile();
84 void initTapHandler();
85 void destroyTapHandler();
86 void handleLongPress();
87
88 bool acceptKeyClick(Qt::Key key) const override;
89
90 QQuickDialog *dialog = nullptr;
95};
96
97QT_END_NAMESPACE
98
99#endif // QQUICKFILEDIALOGDELEGATE_P_P_H
bool acceptKeyClick(Qt::Key key) const override
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)