summaryrefslogtreecommitdiffstats
path: root/examples/charts/chartsgallery/calloutwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'examples/charts/chartsgallery/calloutwidget.cpp')
-rw-r--r--examples/charts/chartsgallery/calloutwidget.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/examples/charts/chartsgallery/calloutwidget.cpp b/examples/charts/chartsgallery/calloutwidget.cpp
new file mode 100644
index 00000000..e3571f15
--- /dev/null
+++ b/examples/charts/chartsgallery/calloutwidget.cpp
@@ -0,0 +1,19 @@
+// Copyright (C) 2023 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
+
+#include "calloutview.h"
+#include "calloutwidget.h"
+
+CalloutWidget::CalloutWidget(QWidget *parent)
+ : ContentWidget(parent)
+{
+ // To make mouse tracking work, we need to subclass the QGraphicsView instead of just having
+ // it as member of this class
+ m_view = new CalloutView(this);
+ m_view->resize(size());
+}
+
+void CalloutWidget::resizeEvent(QResizeEvent *)
+{
+ m_view->resize(size());
+}