1 | // Copyright (C) 2015 Klaralvdalens Datakonsult AB (KDAB). |
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #ifndef QT3DRENDER_QOBJECTPICKER_H |
5 | #define QT3DRENDER_QOBJECTPICKER_H |
6 | |
7 | #include <Qt3DCore/qcomponent.h> |
8 | #include <Qt3DRender/qt3drender_global.h> |
9 | |
10 | QT_BEGIN_NAMESPACE |
11 | |
12 | namespace Qt3DRender { |
13 | |
14 | class QObjectPickerPrivate; |
15 | class QPickEvent; |
16 | |
17 | class Q_3DRENDERSHARED_EXPORT QObjectPicker : public Qt3DCore::QComponent |
18 | { |
19 | Q_OBJECT |
20 | Q_PROPERTY(bool hoverEnabled READ isHoverEnabled WRITE setHoverEnabled NOTIFY hoverEnabledChanged) |
21 | Q_PROPERTY(bool dragEnabled READ isDragEnabled WRITE setDragEnabled NOTIFY dragEnabledChanged) |
22 | Q_PROPERTY(bool pressed READ isPressed NOTIFY pressedChanged) |
23 | Q_PROPERTY(bool containsMouse READ containsMouse NOTIFY containsMouseChanged) |
24 | Q_PROPERTY(int priority READ priority WRITE setPriority NOTIFY priorityChanged REVISION 13) |
25 | |
26 | public: |
27 | explicit QObjectPicker(QNode *parent = nullptr); |
28 | ~QObjectPicker(); |
29 | |
30 | bool isHoverEnabled() const; |
31 | bool isDragEnabled() const; |
32 | |
33 | bool containsMouse() const; |
34 | bool isPressed() const; |
35 | |
36 | int priority() const; |
37 | |
38 | public Q_SLOTS: |
39 | void setHoverEnabled(bool hoverEnabled); |
40 | void setDragEnabled(bool dragEnabled); |
41 | Q_REVISION(13) void setPriority(int priority); |
42 | |
43 | Q_SIGNALS: |
44 | void pressed(Qt3DRender::QPickEvent *pick); |
45 | void released(Qt3DRender::QPickEvent *pick); |
46 | void clicked(Qt3DRender::QPickEvent *pick); |
47 | void moved(Qt3DRender::QPickEvent *pick); |
48 | void entered(); |
49 | void exited(); |
50 | void hoverEnabledChanged(bool hoverEnabled); |
51 | void dragEnabledChanged(bool dragEnabled); |
52 | void pressedChanged(bool pressed); |
53 | void containsMouseChanged(bool containsMouse); |
54 | Q_REVISION(13) void priorityChanged(int priority); |
55 | |
56 | private: |
57 | Q_DECLARE_PRIVATE(QObjectPicker) |
58 | }; |
59 | |
60 | } // Qt3D |
61 | |
62 | QT_END_NAMESPACE |
63 | |
64 | #endif // QT3DRENDER_QOBJECTPICKER_H |
65 | |