aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@nokia.com>2011-12-19 16:58:31 +0100
committerQt by Nokia <qt-info@nokia.com>2011-12-20 12:40:31 +0100
commitb899758264bc29ecc80e04d4fbbe1832f01a9a08 (patch)
treef1b649b3c2aeeb512bd29c8b2f371b0e601d78d6 /src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h
parent0eca9de42e4e7fc690c7b096d49aec9dde7a575f (diff)
Debugger: Get rid of SG* prefix in qtquick2 plugin
Change-Id: Ib8a40d633c169652258480748cfc162593ed9f6c Reviewed-by: Christiaan Janssen <christiaan.janssen@nokia.com>
Diffstat (limited to 'src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h')
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h112
1 files changed, 112 insertions, 0 deletions
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h
new file mode 100644
index 0000000000..94fa4c246a
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/qquickviewinspector.h
@@ -0,0 +1,112 @@
+/****************************************************************************
+**
+** 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 QQUICKVIEWINSPECTOR_H
+#define QQUICKVIEWINSPECTOR_H
+
+#include "abstractviewinspector.h"
+
+#include <QtCore/QWeakPointer>
+#include <QtCore/QHash>
+
+QT_BEGIN_NAMESPACE
+class QQuickView;
+class QQuickItem;
+QT_END_NAMESPACE
+
+namespace QmlJSDebugger {
+namespace QtQuick2 {
+
+class SelectionTool;
+class SelectionHighlight;
+
+class QQuickViewInspector : public AbstractViewInspector
+{
+ Q_OBJECT
+public:
+ explicit QQuickViewInspector(QQuickView *view, QObject *parent = 0);
+
+ // AbstractViewInspector
+ void changeCurrentObjects(const QList<QObject*> &objects);
+ void reloadView();
+ void reparentQmlObject(QObject *object, QObject *newParent);
+ void changeTool(InspectorProtocol::Tool tool);
+ Qt::WindowFlags windowFlags() const;
+ void setWindowFlags(Qt::WindowFlags flags);
+ QDeclarativeEngine *declarativeEngine() const;
+
+ QQuickView *view() const { return m_view; }
+ QQuickItem *overlay() const { return m_overlay; }
+
+ QQuickItem *topVisibleItemAt(const QPointF &pos) const;
+ QList<QQuickItem *> itemsAt(const QPointF &pos) const;
+
+ QList<QQuickItem *> selectedItems() const;
+ void setSelectedItems(const QList<QQuickItem*> &items);
+
+ QString titleForItem(QQuickItem *item) const;
+
+protected:
+ bool eventFilter(QObject *obj, QEvent *event);
+
+ bool mouseMoveEvent(QMouseEvent *);
+
+private slots:
+ void removeFromSelectedItems(QObject *);
+
+private:
+ bool syncSelectedItems(const QList<QQuickItem*> &items);
+
+ QQuickView *m_view;
+ QQuickItem *m_overlay;
+
+ SelectionTool *m_selectionTool;
+
+ QList<QWeakPointer<QQuickItem> > m_selectedItems;
+ QHash<QQuickItem*, SelectionHighlight*> m_highlightItems;
+
+ bool m_designMode;
+};
+
+} // namespace QtQuick2
+} // namespace QmlJSDebugger
+
+#endif // QQUICKVIEWINSPECTOR_H