MNE-CPP 0.1.9
A Framework for Electrophysiology
Loading...
Searching...
No Matches
lineplot.h
Go to the documentation of this file.
1//=============================================================================================================
36#ifndef LINEPLOT_H
37#define LINEPLOT_H
38
39//=============================================================================================================
40// INCLUDES
41//=============================================================================================================
42
43#include "../disp_global.h"
44
45//=============================================================================================================
46// EIGEN INCLUDES
47//=============================================================================================================
48
49#include <Eigen/Core>
50
51//=============================================================================================================
52// QT INCLUDES
53//=============================================================================================================
54
55#include <QChart>
56#include <QChartView>
57#include <QLineSeries>
58#include <QSharedPointer>
59
60//=============================================================================================================
61// FORWARD DECLARATIONS
62//=============================================================================================================
63
64//=============================================================================================================
65// DEFINE NAMESPACE DISPLIB
66//=============================================================================================================
67
68namespace DISPLIB
69{
70
71//=============================================================================================================
72// DISPLIBFORWARD DECLARATIONS
73//=============================================================================================================
74
75//=============================================================================================================
83#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
84class DISPSHARED_EXPORT LinePlot : public QtCharts::QChartView
85#else
86class DISPSHARED_EXPORT LinePlot : public QChartView
87#endif
88{
89 Q_OBJECT
90
91public:
92 typedef QSharedPointer<LinePlot> SPtr;
93 typedef QSharedPointer<const LinePlot> ConstSPtr;
95 //=========================================================================================================
101 LinePlot(QWidget *parent = Q_NULLPTR);
102
103 //=========================================================================================================
111 LinePlot(const QVector<double>& y,
112 const QString& title = "",
113 QWidget *parent = Q_NULLPTR);
114
115 //=========================================================================================================
124 LinePlot(const QVector<double>& x,
125 const QVector<double>& y,
126 const QString& title = "",
127 QWidget *parent = Q_NULLPTR);
128
129 //=========================================================================================================
133 virtual ~LinePlot();
134
135 //=========================================================================================================
141 void setTitle(const QString &p_sTitle);
142
143 //=========================================================================================================
149 void setXLabel(const QString &p_sXLabel);
150
151 //=========================================================================================================
157 void setYLabel(const QString &p_sYLabel);
158
159 //=========================================================================================================
165 void updateData(const QVector<double>& y);
166
167 //=========================================================================================================
174 void updateData(const QVector<double>& x,
175 const QVector<double>& y);
176
177private:
178 //=========================================================================================================
182 void update();
183
184private:
185 QString m_sTitle;
186 QString m_sXLabel;
187 QString m_sYLabel;
191#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
192 QtCharts::QLineSeries* m_pLineSeries;
193 QtCharts::QChart* m_pChart;
194#else
195 QLineSeries* m_pLineSeries;
196 QChart* m_pChart;
197#endif
198};
199
200//=============================================================================================================
201// INLINE DEFINITIONS
202//=============================================================================================================
203} // NAMESPACE
204
205#endif // LINEPLOT_H
#define DISPSHARED_EXPORT
Definition disp_global.h:55
Line Plot.
Definition lineplot.h:88
QSharedPointer< LinePlot > SPtr
Definition lineplot.h:92
QSharedPointer< const LinePlot > ConstSPtr
Definition lineplot.h:93