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