aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmltooling/qmldbg_qtquick2/highlight.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/highlight.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/highlight.h')
-rw-r--r--src/plugins/qmltooling/qmldbg_qtquick2/highlight.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/src/plugins/qmltooling/qmldbg_qtquick2/highlight.h b/src/plugins/qmltooling/qmldbg_qtquick2/highlight.h
new file mode 100644
index 0000000000..c8813c542d
--- /dev/null
+++ b/src/plugins/qmltooling/qmldbg_qtquick2/highlight.h
@@ -0,0 +1,99 @@
+/****************************************************************************
+**
+** 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 HIGHLIGHT_H
+#define HIGHLIGHT_H
+
+#include <QtCore/QWeakPointer>
+#include <QtQuick/QQuickPaintedItem>
+
+namespace QmlJSDebugger {
+namespace QtQuick2 {
+
+class Highlight : public QQuickPaintedItem
+{
+ Q_OBJECT
+
+public:
+ Highlight(QQuickItem *parent) : QQuickPaintedItem(parent) {}
+ Highlight(QQuickItem *item, QQuickItem *parent);
+
+ void setItem(QQuickItem *item);
+
+private slots:
+ void adjust();
+
+private:
+ QWeakPointer<QQuickItem> m_item;
+};
+
+/**
+ * A highlight suitable for indicating selection.
+ */
+class SelectionHighlight : public Highlight
+{
+public:
+ SelectionHighlight(QQuickItem *item, QQuickItem *parent)
+ : Highlight(item, parent)
+ {}
+
+ void paint(QPainter *painter);
+};
+
+/**
+ * A highlight suitable for indicating hover.
+ */
+class HoverHighlight : public Highlight
+{
+public:
+ HoverHighlight(QQuickItem *parent)
+ : Highlight(parent)
+ {
+ setZ(1); // hover highlight on top of selection highlight
+ }
+
+ void paint(QPainter *painter);
+};
+
+} // namespace QtQuick2
+} // namespace QmlJSDebugger
+
+#endif // HIGHLIGHT_H