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
inspecttool.h
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant
4
5#ifndef INSPECTTOOL_H
6#define INSPECTTOOL_H
7
8#include <QtCore/QPointF>
9#include <QtCore/QPointer>
10#include <QtCore/QTimer>
11
13
14class QQuickWindow;
15class QQuickItem;
16class QMouseEvent;
17class QKeyEvent;
18class QTouchEvent;
19class QEnterEvent;
20
21namespace QmlJSDebugger {
22
23class GlobalInspector;
25class HoverHighlight;
26
27class InspectTool : public QObject
28{
30public:
32
33 void enterEvent(QEnterEvent *);
34 void leaveEvent(QEvent *);
35 void mousePressEvent(QMouseEvent *);
36 void mouseMoveEvent(QMouseEvent *);
37 void mouseDoubleClickEvent(QMouseEvent *);
38 void hoverMoveEvent(QMouseEvent *);
39 void keyPressEvent(QKeyEvent *) {}
40 void keyReleaseEvent(QKeyEvent *);
41 void touchEvent(QTouchEvent *event);
42
43private:
44 void selectNextItem();
45 void selectItem();
46 void showItemName();
47
48 QQuickWindowInspector *inspector() const;
49 GlobalInspector *globalInspector() const;
50
51 bool m_tapEvent;
52 QPointer<QQuickItem> m_contentItem;
53 QPointF m_mousePosition;
54 ulong m_touchTimestamp;
55 QTimer m_nameDisplayTimer;
56
57 HoverHighlight *m_hoverHighlight;
58 QQuickItem *m_lastItem;
59 QQuickItem *m_lastClickedItem;
60};
61
62} // namespace QmlJSDebugger
63
64QT_END_NAMESPACE
65
66#endif // INSPECTTOOL_H
void processMessage(const QByteArray &message)
void setParentWindow(QQuickWindow *window, QWindow *parentWindow)
void removeWindow(QQuickWindow *window)
void setQmlEngine(QQuickWindow *window, QQmlEngine *engine)
void showSelectedItemName(QQuickItem *item, const QPointF &point)
void setSelectedItems(const QList< QQuickItem * > &items)
void addWindow(QQuickWindow *window)
QQuickItem * item()
Definition highlight.h:26
QTransform transform()
Definition highlight.h:29
void paint(QPainter *painter) override
This function, which is usually called by the QML Scene Graph, paints the contents of an item in loca...
Definition highlight.cpp:89
void hoverMoveEvent(QMouseEvent *)
void mouseDoubleClickEvent(QMouseEvent *)
void touchEvent(QTouchEvent *event)
void keyReleaseEvent(QKeyEvent *)
void mousePressEvent(QMouseEvent *)
void enterEvent(QEnterEvent *)
void mouseMoveEvent(QMouseEvent *)
void keyPressEvent(QKeyEvent *)
Definition inspecttool.h:39
QQuickItem * topVisibleItemAt(const QPointF &pos) const
QList< QQuickItem * > itemsAt(const QPointF &pos) const
bool eventFilter(QObject *, QEvent *) override
Filters events if this object has been installed as an event filter for the watched object.
void paint(QPainter *painter) override
This function, which is usually called by the QML Scene Graph, paints the contents of an item in loca...
void showName(const QPointF &displayPoint)
const char RESPONSE[]
const char SHOW_APP_ON_TOP[]
const char MOVE_OBJECT[]
const char SET_ANIMATION_SPEED[]
const char SELECT[]
const char DISABLE[]
const char ENABLE[]
const char REQUEST[]
const char CREATE_OBJECT[]
const char EVENT[]
const char DESTROY_OBJECT[]
Combined button and popup list for selecting options.
static bool reparentQmlObject(QObject *object, QObject *newParent)