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
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// Qt-Security score:significant reason:default
4
5#ifndef QWAYLANDMOUSETRACKER_P_H
6#define QWAYLANDMOUSETRACKER_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/private/qquickmousearea_p.h>
20
21#include <QtWaylandCompositor/qtwaylandcompositorglobal.h>
22
23QT_BEGIN_NAMESPACE
24
25class QWaylandMouseTrackerPrivate;
26
27class Q_WAYLANDCOMPOSITOR_EXPORT QWaylandMouseTracker : public QQuickItem
28{
29 Q_OBJECT
30 Q_DECLARE_PRIVATE(QWaylandMouseTracker)
31 Q_PROPERTY(qreal mouseX READ mouseX NOTIFY mouseXChanged)
32 Q_PROPERTY(qreal mouseY READ mouseY NOTIFY mouseYChanged)
33 Q_PROPERTY(bool containsMouse READ hovered NOTIFY hoveredChanged)
34
35 Q_PROPERTY(bool windowSystemCursorEnabled READ windowSystemCursorEnabled WRITE setWindowSystemCursorEnabled NOTIFY windowSystemCursorEnabledChanged)
36 QML_NAMED_ELEMENT(WaylandMouseTracker)
37 QML_ADDED_IN_VERSION(1, 0)
38public:
39 QWaylandMouseTracker(QQuickItem *parent = nullptr);
40
41 qreal mouseX() const;
42 qreal mouseY() const;
43
44 void setWindowSystemCursorEnabled(bool enable);
45 bool windowSystemCursorEnabled() const;
46 bool hovered() const;
47
48Q_SIGNALS:
49 void mouseXChanged();
50 void mouseYChanged();
51 void windowSystemCursorEnabledChanged();
52 void hoveredChanged();
53
54protected:
55 bool childMouseEventFilter(QQuickItem *item, QEvent *event) override;
56 void mouseMoveEvent(QMouseEvent *event) override;
57 void hoverMoveEvent(QHoverEvent *event) override;
58 void hoverEnterEvent(QHoverEvent *event) override;
59 void hoverLeaveEvent(QHoverEvent *event) override;
60};
61
62QT_END_NAMESPACE
63
64#endif /*QWAYLANDMOUSETRACKER_P_H*/
Combined button and popup list for selecting options.