| 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 | |
| 4 | #ifndef QQUICKWINDOWINSPECTOR_H |
| 5 | #define QQUICKWINDOWINSPECTOR_H |
| 6 | |
| 7 | #include <QtCore/QObject> |
| 8 | |
| 9 | QT_BEGIN_NAMESPACE |
| 10 | |
| 11 | class QQmlDebugService; |
| 12 | class QQuickWindow; |
| 13 | class QQmlEngine; |
| 14 | class QWindow; |
| 15 | class QQuickItem; |
| 16 | |
| 17 | namespace QmlJSDebugger { |
| 18 | |
| 19 | class InspectTool; |
| 20 | class GlobalInspector; |
| 21 | |
| 22 | /* |
| 23 | * The common code between QQuickView and QQuickView inspectors lives here, |
| 24 | */ |
| 25 | class QQuickWindowInspector : public QObject |
| 26 | { |
| 27 | Q_OBJECT |
| 28 | |
| 29 | public: |
| 30 | explicit QQuickWindowInspector(QQuickWindow *quickWindow, QObject *parent = nullptr); |
| 31 | |
| 32 | QQuickItem *overlay() const { return m_overlay; } |
| 33 | QQuickItem *topVisibleItemAt(const QPointF &pos) const; |
| 34 | QList<QQuickItem *> itemsAt(const QPointF &pos) const; |
| 35 | |
| 36 | QQuickWindow *quickWindow() const; |
| 37 | |
| 38 | void setParentWindow(QWindow *parentWindow); |
| 39 | void setShowAppOnTop(bool appOnTop); |
| 40 | |
| 41 | bool isEnabled() const; |
| 42 | void setEnabled(bool enabled); |
| 43 | |
| 44 | protected: |
| 45 | bool eventFilter(QObject *, QEvent *) override; |
| 46 | |
| 47 | private: |
| 48 | QQuickItem *m_overlay; |
| 49 | QQuickWindow *m_window; |
| 50 | QWindow *m_parentWindow; |
| 51 | InspectTool *m_tool; |
| 52 | }; |
| 53 | |
| 54 | } // namespace QmlJSDebugger |
| 55 | |
| 56 | QT_END_NAMESPACE |
| 57 | |
| 58 | #endif // QQUICKWINDOWINSPECTOR_H |
| 59 |
