Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qwaylanddrag.cpp
Go to the documentation of this file.
1// Copyright (C) 2017 Klarälvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#include "qwaylanddrag.h"
5
6#include <private/qobject_p.h>
7
8#include "qwaylandview.h"
9#include <QtWaylandCompositor/private/qwaylandseat_p.h>
10#include <QtWaylandCompositor/private/qtwaylandcompositorglobal_p.h>
11
12#if QT_CONFIG(wayland_datadevice)
13#include "qwldatadevice_p.h"
14#endif
15
17
19{
20public:
25
27 {
28 return QWaylandSeatPrivate::get(seat)->dataDevice();
29 }
30
32 {
33 return QWaylandSeatPrivate::get(seat)->dataDevice();
34 }
35
36 QWaylandSeat *seat = nullptr;
37};
38
43
45{
46 Q_D(const QWaylandDrag);
47
48 const QtWayland::DataDevice *dataDevice = d->dataDevice();
49 if (!dataDevice)
50 return nullptr;
51
52 return dataDevice->dragIcon();
53}
54
56{
57 Q_D(const QWaylandDrag);
58 const QtWayland::DataDevice *dataDevice = d->dataDevice();
59 return dataDevice ? dataDevice->dragOrigin() : nullptr;
60}
61
63{
64 Q_D(const QWaylandDrag);
65 return d->seat;
66}
67
68
70{
71 Q_D(const QWaylandDrag);
72
73 const QtWayland::DataDevice *dataDevice = d->dataDevice();
74 if (!dataDevice)
75 return false;
76
77 return dataDevice->dragIcon() != nullptr;
78}
79
81{
82 Q_D(QWaylandDrag);
83 QtWayland::DataDevice *dataDevice = d->dataDevice();
84 if (!dataDevice)
85 return;
86 dataDevice->dragMove(target, pos);
87}
89{
90 Q_D(QWaylandDrag);
91 QtWayland::DataDevice *dataDevice = d->dataDevice();
92 if (!dataDevice)
93 return;
94 dataDevice->drop();
95}
96
98{
99 Q_D(QWaylandDrag);
100 QtWayland::DataDevice *dataDevice = d->dataDevice();
101 if (!dataDevice)
102 return;
103 dataDevice->cancelDrag();
104}
105
107
108#include "moc_qwaylanddrag.cpp"
\inmodule QtCore
Definition qobject.h:103
\inmodule QtCore\reentrant
Definition qpoint.h:217
const QtWayland::DataDevice * dataDevice() const
QtWayland::DataDevice * dataDevice()
QWaylandSeat * seat
QWaylandDragPrivate(QWaylandSeat *seat)
QWaylandDrag(QWaylandSeat *seat)
QWaylandSurface * icon
QWaylandSeat * seat() const
QWaylandSurface * origin() const
void dragMove(QWaylandSurface *target, const QPointF &pos)
static QWaylandSeatPrivate * get(QWaylandSeat *device)
\qmltype WaylandSeat \instantiates QWaylandSeat \inqmlmodule QtWayland.Compositor
\qmltype WaylandSurface \instantiates QWaylandSurface \inqmlmodule QtWayland.Compositor
Combined button and popup list for selecting options.
GLenum target