summaryrefslogtreecommitdiffstats
path: root/examples/charts/gallery/interactionsview.h
blob: 04a27b411fceaf0ae6578a55bcbd50a8be77ae76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef INTERACTIONSVIEW_H
#define INTERACTIONSVIEW_H

#include <QChartView>
#include <QPoint>

class InteractionsChart;

class InteractionsView : public QChartView
{
public:
    InteractionsView(InteractionsChart *chart, QWidget *parent = nullptr);

protected:
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

private:
    InteractionsChart *m_chart = nullptr;
    QPoint m_mousePos;
};

#endif