blob: bd3789ff3efbb5a8c73c0ac22f35df901f2698cd (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef INSPECTTOOL_H
#define INSPECTTOOL_H
#include <QtCore/QPointF>
#include <QtCore/QPointer>
#include <QtCore/QTimer>
QT_BEGIN_NAMESPACE
class QQuickWindow;
class QQuickItem;
class QMouseEvent;
class QKeyEvent;
class QTouchEvent;
class QEnterEvent;
namespace QmlJSDebugger {
class GlobalInspector;
class QQuickWindowInspector;
class HoverHighlight;
class InspectTool : public QObject
{
Q_OBJECT
public:
InspectTool(QQuickWindowInspector *inspector, QQuickWindow *view);
void enterEvent(QEnterEvent *);
void leaveEvent(QEvent *);
void mousePressEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *);
void mouseDoubleClickEvent(QMouseEvent *);
void hoverMoveEvent(QMouseEvent *);
void keyPressEvent(QKeyEvent *) {}
void keyReleaseEvent(QKeyEvent *);
void touchEvent(QTouchEvent *event);
private:
void selectNextItem();
void selectItem();
void showItemName();
QQuickWindowInspector *inspector() const;
GlobalInspector *globalInspector() const;
bool m_tapEvent;
QPointer<QQuickItem> m_contentItem;
QPointF m_mousePosition;
ulong m_touchTimestamp;
QTimer m_nameDisplayTimer;
HoverHighlight *m_hoverHighlight;
QQuickItem *m_lastItem;
QQuickItem *m_lastClickedItem;
};
} // namespace QmlJSDebugger
QT_END_NAMESPACE
#endif // INSPECTTOOL_H
|