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
qwaylandmousetracker_p.h
Go to the documentation of this file.
1// Copyright (C) 2017 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QWAYLANDMOUSETRACKER_P_H
5#define QWAYLANDMOUSETRACKER_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtQuick/private/qquickmousearea_p.h>
19
20#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
21
23
25
26class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandMouseTracker : public QQuickItem
27{
29 Q_DECLARE_PRIVATE(QWaylandMouseTracker)
30 Q_PROPERTY(qreal mouseX READ mouseX NOTIFY mouseXChanged)
31 Q_PROPERTY(qreal mouseY READ mouseY NOTIFY mouseYChanged)
32 Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged)
33
34 Q_PROPERTY(bool windowSystemCursorEnabled READ windowSystemCursorEnabled WRITE setWindowSystemCursorEnabled NOTIFY windowSystemCursorEnabledChanged)
35 QML_NAMED_ELEMENT(WaylandMouseTracker)
37public:
38 QWaylandMouseTracker(QQuickItem *parent = nullptr);
39
40 qreal mouseX() const;
41 qreal mouseY() const;
42
43 void setWindowSystemCursorEnabled(bool enable);
44 bool windowSystemCursorEnabled() const;
45 bool hovered() const;
46
48 void mouseXChanged();
49 void mouseYChanged();
50 void windowSystemCursorEnabledChanged();
51 void hoveredChanged();
52
53protected:
54 bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;
55 void mouseMoveEvent(QMouseEvent *event) override;
56 void hoverMoveEvent(QHoverEvent *event) override;
57 void hoverEnterEvent(QHoverEvent *event) override;
58 void hoverLeaveEvent(QHoverEvent *event) override;
59};
60
62
63#endif /*QWAYLANDMOUSETRACKER_P_H*/
\inmodule QtCore
Definition qcoreevent.h:45
\inmodule QtGui
Definition qevent.h:246
\inmodule QtGui
Definition qevent.h:196
The QQuickItem class provides the most basic of all visual items in \l {Qt Quick}.
Definition qquickitem.h:63
Combined button and popup list for selecting options.
GLboolean enable
struct _cl_event * event
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
QGraphicsItem * item