summaryrefslogtreecommitdiffstats
path: root/tests/manual/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
diff options
context:
space:
mode:
Diffstat (limited to 'tests/manual/examples/widgets/graphicsview/embeddeddialogs/customproxy.h')
-rw-r--r--tests/manual/examples/widgets/graphicsview/embeddeddialogs/customproxy.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/manual/examples/widgets/graphicsview/embeddeddialogs/customproxy.h b/tests/manual/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
new file mode 100644
index 0000000000..444d39e73e
--- /dev/null
+++ b/tests/manual/examples/widgets/graphicsview/embeddeddialogs/customproxy.h
@@ -0,0 +1,39 @@
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
+
+#ifndef CUSTOMPROXY_H
+#define CUSTOMPROXY_H
+
+#include <QTimeLine>
+#include <QGraphicsProxyWidget>
+
+class CustomProxy : public QGraphicsProxyWidget
+{
+ Q_OBJECT
+
+public:
+ explicit CustomProxy(QGraphicsItem *parent = nullptr, Qt::WindowFlags wFlags = { });
+
+ QRectF boundingRect() const override;
+ void paintWindowFrame(QPainter *painter, const QStyleOptionGraphicsItem *option,
+ QWidget *widget) override;
+
+protected:
+ void hoverEnterEvent(QGraphicsSceneHoverEvent *event) override;
+ void hoverLeaveEvent(QGraphicsSceneHoverEvent *event) override;
+ bool sceneEventFilter(QGraphicsItem *watched, QEvent *event) override;
+ QVariant itemChange(GraphicsItemChange change, const QVariant &value) override;
+
+private slots:
+ void updateStep(qreal step);
+ void stateChanged(QTimeLine::State);
+ void zoomIn();
+ void zoomOut();
+
+private:
+ QTimeLine *timeLine;
+ QGraphicsItem *currentPopup = nullptr;
+ bool popupShown = false;
+};
+
+#endif // CUSTOMPROXY_H