Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Toggle main menu visibility
Loading...
Searching...
No Matches
qquickselectionrectangle_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
QQUICKSELECTIONRECTANGLE_P_H
6
#
define
QQUICKSELECTIONRECTANGLE_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
<
QtQuick
/
qquickitem
.
h
>
20
#
include
<
QtQuickTemplates2
/
private
/
qquickcontrol_p
.
h
>
21
22
#
include
<
QtCore
/
qpointer
.
h
>
23
24
QT_BEGIN_NAMESPACE
25
26
class
QQuickSelectionRectanglePrivate;
27
class
QQuickSelectable;
28
class
QQuickSelectionRectangleAttached;
29
class
QQmlComponent;
30
31
class
Q_QUICKTEMPLATES2_EXPORT
QQuickSelectionRectangle
:
public
QQuickControl
32
{
33
Q_OBJECT
34
Q_PROPERTY(SelectionMode selectionMode READ selectionMode WRITE setSelectionMode NOTIFY selectionModeChanged FINAL)
35
Q_PROPERTY(QQuickItem *target READ target WRITE setTarget NOTIFY targetChanged FINAL)
36
Q_PROPERTY(QQmlComponent *topLeftHandle READ topLeftHandle WRITE setTopLeftHandle NOTIFY topLeftHandleChanged FINAL)
37
Q_PROPERTY(QQmlComponent *bottomRightHandle READ bottomRightHandle WRITE setBottomRightHandle NOTIFY bottomRightHandleChanged FINAL)
38
Q_PROPERTY(
bool
active READ active NOTIFY activeChanged FINAL)
39
Q_PROPERTY(
bool
dragging READ dragging NOTIFY draggingChanged FINAL)
40
41
QML_NAMED_ELEMENT(SelectionRectangle)
42
QML_ATTACHED(QQuickSelectionRectangleAttached)
43
QML_ADDED_IN_VERSION(6, 2)
44
45
public
:
46
enum
SelectionMode {
47
Drag,
48
PressAndHold,
49
Auto
50
};
51
Q_ENUM(SelectionMode)
52
53
explicit
QQuickSelectionRectangle(QQuickItem *parent =
nullptr
);
54
55
QQuickItem *target()
const
;
56
void
setTarget(QQuickItem *target);
57
58
bool
active();
59
bool
dragging();
60
61
SelectionMode selectionMode()
const
;
62
void
setSelectionMode(SelectionMode selectionMode);
63
64
QQmlComponent *topLeftHandle()
const
;
65
void
setTopLeftHandle(QQmlComponent *topLeftHandle);
66
QQmlComponent *bottomRightHandle()
const
;
67
void
setBottomRightHandle(QQmlComponent *bottomRightHandle);
68
69
static
QQuickSelectionRectangleAttached *qmlAttachedProperties(QObject *obj);
70
71
Q_SIGNALS:
72
void
targetChanged();
73
void
activeChanged();
74
void
draggingChanged();
75
void
topLeftHandleChanged();
76
void
bottomRightHandleChanged();
77
void
selectionModeChanged();
78
79
private
:
80
Q_DISABLE_COPY(QQuickSelectionRectangle)
81
Q_DECLARE_PRIVATE(QQuickSelectionRectangle)
82
};
83
84
class
Q_QUICKTEMPLATES2_EXPORT
QQuickSelectionRectangleAttached
:
public
QObject
85
{
86
Q_OBJECT
87
Q_PROPERTY(QQuickSelectionRectangle *control READ control NOTIFY controlChanged FINAL)
88
Q_PROPERTY(
bool
dragging READ dragging NOTIFY draggingChanged FINAL)
89
90
public
:
91
QQuickSelectionRectangleAttached(QObject *parent);
92
93
QQuickSelectionRectangle *control()
const
;
94
void
setControl(QQuickSelectionRectangle *control);
95
96
bool
dragging()
const
;
97
void
setDragging(
bool
dragging);
98
99
Q_SIGNALS:
100
void
controlChanged();
101
void
draggingChanged();
102
103
private
:
104
QPointer<QQuickSelectionRectangle> m_control;
105
bool
m_dragging =
false
;
106
107
friend
class
QQuickSelectionRectanglePrivate;
108
};
109
110
QT_END_NAMESPACE
111
112
#
endif
// QQUICKSELECTIONRECTANGLE_P_H
QQuickSelectionRectangleAttached
Definition
qquickselectionrectangle_p.h:85
QQuickSelectionRectanglePrivate
Definition
qquickselectionrectangle_p_p.h:33
QQuickSelectionRectanglePrivate::m_selectable
QQuickSelectable * m_selectable
Definition
qquickselectionrectangle_p_p.h:60
QQuickSelectionRectanglePrivate::updateActiveState
void updateActiveState(bool isActive)
Definition
qquickselectionrectangle.cpp:394
QQuickSelectionRectanglePrivate::m_active
bool m_active
Definition
qquickselectionrectangle_p_p.h:73
QQuickSelectionRectanglePrivate::updateHandles
void updateHandles()
Definition
qquickselectionrectangle.cpp:496
QQuickSelectionRectanglePrivate::updateSelectionMode
void updateSelectionMode()
Definition
qquickselectionrectangle.cpp:545
QQuickSelectionRectanglePrivate::createHandle
QQuickItem * createHandle(QQmlComponent *delegate, Qt::Corner corner)
Definition
qquickselectionrectangle.cpp:413
QQuickSelectionRectanglePrivate::updateDraggingState
void updateDraggingState(bool isDragging)
Definition
qquickselectionrectangle.cpp:383
QQuickSelectionRectanglePrivate::m_dragging
bool m_dragging
Definition
qquickselectionrectangle_p_p.h:74
QQuickSelectionRectanglePrivate::handleUnderPos
QQuickItem * handleUnderPos(const QPointF &pos)
Definition
qquickselectionrectangle.cpp:365
QQuickSelectionRectanglePrivate::scrollTowardsPos
void scrollTowardsPos(const QPointF &pos)
Definition
qquickselectionrectangle.cpp:354
QQuickSelectionRectanglePrivate::getAttachedObject
QQuickSelectionRectangleAttached * getAttachedObject(const QObject *object) const
Definition
qquickselectionrectangle.cpp:589
QQuickSelectionRectanglePrivate::connectToTarget
void connectToTarget()
Definition
qquickselectionrectangle.cpp:517
QQuickSelectionRectangle
Definition
qquickselectionrectangle_p.h:32
QT_BEGIN_NAMESPACE
Combined button and popup list for selecting options.
Definition
qsequentialanimationgroup.cpp:47
qtdeclarative
src
quicktemplates
qquickselectionrectangle_p.h
Generated on
for Qt by
1.18.0