summaryrefslogtreecommitdiffstats
path: root/examples/charts/gallery/legendmarkerswidget.h
blob: 78b2662305b27fa8990b25b907fd830428b38c2b (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
28
29
30
31
32
33
34
35
// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef LEGENDMARKERSWIDGET_H
#define LEGENDMARKERSWIDGET_H

#include "contentwidget.h"

QT_FORWARD_DECLARE_CLASS(QChart)
QT_FORWARD_DECLARE_CLASS(QChartView)
QT_FORWARD_DECLARE_CLASS(QGridLayout)
QT_FORWARD_DECLARE_CLASS(QLineSeries)

class LegendMarkersWidget : public ContentWidget
{
    Q_OBJECT
public:
    explicit LegendMarkersWidget(QWidget *parent = nullptr);

public slots:
    void addSeries();
    void removeSeries();
    void connectMarkers();
    void disconnectMarkers();
    void handleMarkerClicked();

private:
    QChart *m_chart = nullptr;
    QChartView *m_chartView = nullptr;
    QGridLayout *m_mainLayout = nullptr;
    QGridLayout *m_fontLayout = nullptr;
    QList<QLineSeries *> m_series;
};

#endif