30 Q_DECLARE_PRIVATE(QWaylandQuickItem)
31 Q_PROPERTY(QWaylandCompositor *compositor READ compositor NOTIFY compositorChanged)
32 Q_PROPERTY(QWaylandSurface *surface READ surface WRITE setSurface NOTIFY surfaceChanged)
33 Q_PROPERTY(
bool paintEnabled READ isPaintEnabled WRITE setPaintEnabled NOTIFY paintEnabledChanged)
34 Q_PROPERTY(
bool touchEventsEnabled READ touchEventsEnabled WRITE setTouchEventsEnabled NOTIFY touchEventsEnabledChanged)
35 Q_PROPERTY(QWaylandSurface::Origin origin READ origin NOTIFY originChanged)
36 Q_PROPERTY(
bool inputEventsEnabled READ inputEventsEnabled WRITE setInputEventsEnabled NOTIFY inputEventsEnabledChanged)
37 Q_PROPERTY(
bool focusOnClick READ focusOnClick WRITE setFocusOnClick NOTIFY focusOnClickChanged)
38 Q_PROPERTY(QObject *subsurfaceHandler READ subsurfaceHandler WRITE setSubsurfaceHandler NOTIFY subsurfaceHandlerChanged)
39 Q_PROPERTY(QWaylandOutput *output READ output WRITE setOutput NOTIFY outputChanged)
40 Q_PROPERTY(
bool bufferLocked READ isBufferLocked WRITE setBufferLocked NOTIFY bufferLockedChanged)
41 Q_PROPERTY(
bool allowDiscardFrontBuffer READ allowDiscardFrontBuffer WRITE setAllowDiscardFrontBuffer NOTIFY allowDiscardFrontBufferChanged)
42 Q_MOC_INCLUDE(
"qwaylandcompositor.h")
43 Q_MOC_INCLUDE(
"qwaylandseat.h")
44 Q_MOC_INCLUDE(
"qwaylanddrag.h")
45 QML_NAMED_ELEMENT(WaylandQuickItem)
46 QML_ADDED_IN_VERSION(1, 0)
48 QWaylandQuickItem(QQuickItem *parent =
nullptr);
49 ~QWaylandQuickItem() override;
51 QWaylandCompositor *compositor()
const;
52 QWaylandView *view()
const;
54 QWaylandSurface *surface()
const;
55 void setSurface(QWaylandSurface *surface);
57 QWaylandSurface::Origin origin()
const;
59 bool isTextureProvider()
const override;
60 QSGTextureProvider *textureProvider()
const override;
62 bool isPaintEnabled()
const;
63 bool touchEventsEnabled()
const;
65 void setTouchEventsEnabled(
bool enabled);
67 bool inputEventsEnabled()
const;
68 void setInputEventsEnabled(
bool enabled);
70 bool focusOnClick()
const;
71 void setFocusOnClick(
bool focus);
73 bool inputRegionContains(
const QPointF &localPosition)
const;
74 Q_INVOKABLE QPointF mapToSurface(
const QPointF &point)
const;
75 Q_REVISION(1, 13) Q_INVOKABLE QPointF mapFromSurface(
const QPointF &point)
const;
78 QVariant inputMethodQuery(Qt::InputMethodQuery query)
const override;
79 Q_INVOKABLE QVariant inputMethodQuery(Qt::InputMethodQuery query, QVariant argument)
const;
82 QObject *subsurfaceHandler()
const;
83 void setSubsurfaceHandler(QObject*);
85 QWaylandOutput *output()
const;
86 void setOutput(QWaylandOutput *output);
88 bool isBufferLocked()
const;
89 void setBufferLocked(
bool locked);
91 bool allowDiscardFrontBuffer()
const;
92 void setAllowDiscardFrontBuffer(
bool discard);
94 Q_INVOKABLE
void setPrimary();
97 void mousePressEvent(QMouseEvent *event) override;
98 void mouseMoveEvent(QMouseEvent *event) override;
99 void mouseReleaseEvent(QMouseEvent *event) override;
100 void hoverEnterEvent(QHoverEvent *event) override;
101 void hoverMoveEvent(QHoverEvent *event) override;
102 void hoverLeaveEvent(QHoverEvent *event) override;
103#if QT_CONFIG(wheelevent)
104 void wheelEvent(QWheelEvent *event) override;
107 void keyPressEvent(QKeyEvent *event) override;
108 void keyReleaseEvent(QKeyEvent *event) override;
110 void touchEvent(QTouchEvent *event) override;
111 void touchUngrabEvent() override;
114 void inputMethodEvent(QInputMethodEvent *event) override;
117 virtual void surfaceChangedEvent(QWaylandSurface *newSurface, QWaylandSurface *oldSurface);
119 virtual void takeFocus(QWaylandSeat *device =
nullptr);
120 void setPaintEnabled(
bool paintEnabled);
123 void sendMouseMoveEvent(
const QPointF &position, QWaylandSeat *seat =
nullptr);
125#if QT_VERSION < QT_VERSION_CHECK(7
, 0
, 0
)
127 void surfaceMappedChanged();
131 void handleSurfaceChanged();
132 void handleBufferLockedChanged();
133 void parentChanged(QWaylandSurface *newParent, QWaylandSurface *oldParent);
135 void updateBuffer(
bool hasBuffer);
139 void handleSubsurfaceAdded(QWaylandSurface *childSurface);
140 void handleSubsurfacePosition(
const QPoint &pos);
141 void handlePlaceAbove(QWaylandSurface *referenceSurface);
142 void handlePlaceBelow(QWaylandSurface *referenceSurface);
143#if QT_CONFIG(draganddrop)
144 void handleDragStarted(QWaylandDrag *drag);
147 void updateInputMethod(Qt::InputMethodQueries queries);
152 void surfaceChanged();
153 void compositorChanged();
154 void paintEnabledChanged();
155 void touchEventsEnabledChanged();
156 void originChanged();
157 void surfaceDestroyed();
158 void inputEventsEnabledChanged();
159 void focusOnClickChanged();
160 void mouseMove(
const QPointF &windowPosition);
162 void subsurfaceHandlerChanged();
163 void outputChanged();
164 void bufferLockedChanged();
165 void allowDiscardFrontBufferChanged();
167 QSGNode *updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *data) override;
169 QWaylandQuickItem(QWaylandQuickItemPrivate &dd, QQuickItem *parent =
nullptr);