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
highlight.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 HIGHLIGHT_H
6#define HIGHLIGHT_H
7
8#include <QtCore/QPointer>
9#include <QtCore/QPointF>
10#include <QtGui/QTransform>
11#include <QtQuick/QQuickPaintedItem>
12
14
15namespace QmlJSDebugger {
16
18{
20
21public:
23 Highlight(QQuickItem *item, QQuickItem *parent);
24
25 void setItem(QQuickItem *item);
26 QQuickItem *item() {return m_item;}
27
28protected:
29 QTransform transform() {return m_transform;}
30
31private:
32 void initRenderDetails();
33 void adjust();
34
35private:
36 QPointer<QQuickItem> m_item;
37 QTransform m_transform;
38};
39
40/**
41 * A highlight suitable for indicating selection.
42 */
44{
46
47public:
49 void paint(QPainter *painter) override;
50 void showName(const QPointF &displayPoint);
51
52private:
53 QPointF m_displayPoint;
54 QString m_name;
55 bool m_nameDisplayActive;
56
57 void disableNameDisplay();
58};
59
60/**
61 * A highlight suitable for indicating hover.
62 */
64{
65public:
66 HoverHighlight(QQuickItem *parent)
67 : Highlight(parent)
68 {
69 setZ(1); // hover highlight on top of selection highlight
70 }
71
72 void paint(QPainter *painter) override;
73};
74
75} // namespace QmlJSDebugger
76
77QT_END_NAMESPACE
78
79#endif // HIGHLIGHT_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
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)