aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_inspector/sgviewinspector.h
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2011-06-09 10:52:10 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2011-06-23 16:26:11 +0200
commite753993b14bee1dc631336a4f46416620858479a (patch)
tree29648b4babd885b83b9a5a0810244bd143b25ca6 /src/plugins/qmltooling/qmldbg_inspector/sgviewinspector.h
parenta5c0b25f287fd0e2cfaa8c5e558757c80504ed28 (diff)
QmlInspector: Initial support for QSGView based applications
Currently only displays a rectangle highlighting the item below the mouse, but it's a start. Change-Id: I9946a923add4c53780546ac4bf138fe731508da2
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_inspector/sgviewinspector.h')
-rw-r--r--src/plugins/qmltooling/qmldbg_inspector/sgviewinspector.h92
1 files changed, 92 insertions, 0 deletions
diff --git a/src/plugins/qmltooling/qmldbg_inspector/sgviewinspector.h b/src/plugins/qmltooling/qmldbg_inspector/sgviewinspector.h
new file mode 100644
index 0000000000..226230700d
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_inspector/sgviewinspector.h
@@ -0,0 +1,92 @@
+/****************************************************************************
+**
+** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the QtDeclarative module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** GNU Lesser General Public License Usage
+** This file may be used under the terms of the GNU Lesser General Public
+** License version 2.1 as published by the Free Software Foundation and
+** appearing in the file LICENSE.LGPL included in the packaging of this
+** file. Please review the following information to ensure the GNU Lesser
+** General Public License version 2.1 requirements will be met:
+** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU General
+** Public License version 3.0 as published by the Free Software Foundation
+** and appearing in the file LICENSE.GPL included in the packaging of this
+** file. Please review the following information to ensure the GNU General
+** Public License version 3.0 requirements will be met:
+** http://www.gnu.org/copyleft/gpl.html.
+**
+** Other Usage
+** Alternatively, this file may be used in accordance with the terms and
+** conditions contained in a signed written agreement between you and Nokia.
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QSGVIEWINSPECTOR_H
+#define QSGVIEWINSPECTOR_H
+
+#include <QtCore/QObject>
+#include <QtCore/QWeakPointer>
+
+QT_BEGIN_NAMESPACE
+
+class QMouseEvent;
+class QKeyEvent;
+class QWheelEvent;
+
+class QSGView;
+class QSGItem;
+
+class SGAbstractTool;
+class SGSelectionTool;
+
+class SGViewInspector : public QObject
+{
+ Q_OBJECT
+public:
+ explicit SGViewInspector(QSGView *view, QObject *parent = 0);
+
+ QSGView *view() const { return m_view; }
+ QSGItem *overlay() const { return m_overlay; }
+
+ bool eventFilter(QObject *obj, QEvent *event);
+
+private:
+ bool leaveEvent(QEvent *);
+ bool mousePressEvent(QMouseEvent *event);
+ bool mouseMoveEvent(QMouseEvent *event);
+ bool mouseReleaseEvent(QMouseEvent *event);
+ bool keyPressEvent(QKeyEvent *event);
+ bool keyReleaseEvent(QKeyEvent *keyEvent);
+ bool mouseDoubleClickEvent(QMouseEvent *event);
+ bool wheelEvent(QWheelEvent *event);
+
+ QSGView *m_view;
+ QSGItem *m_overlay;
+ SGAbstractTool *m_currentTool;
+
+ SGSelectionTool *m_selectionTool;
+
+ bool m_designMode;
+};
+
+QT_END_NAMESPACE
+
+#endif // QSGVIEWINSPECTOR_H