/[qspeakers]/branches/qtcharts/plot.h
ViewVC logotype

Contents of /branches/qtcharts/plot.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 287 - (show annotations)
Sun Nov 22 19:11:12 2020 UTC (6 months, 3 weeks ago) by ben
File MIME type: text/plain
File size: 1080 byte(s)
Implement gnuplot export and OpenSCAD export (not finished)
1 #ifndef PLOT_H
2 #define PLOT_H
3
4 #include <QtCharts/QtCharts>
5
6 class Plot : public QChartView
7 {
8 Q_OBJECT
9
10 public:
11 Plot(QWidget *parent = 0);
12 Plot(QString title, QWidget *parent = 0);
13 ~Plot();
14 void appendPointF(const QPointF& pointf);
15 void plot(const QList<double> x, QList<double>y);
16 void clear(void);
17 void setUseOpenGL(bool enable = true);
18
19 void draw3dbVLine();
20 double getXmin() const;
21 double getXmax() const;
22 QLineSeries* series() const;
23
24 protected:
25 void initializeScales();
26 void initializeChart(const QString& title = nullptr);
27 void initializeCurve();
28 void resizeEvent(QResizeEvent *event);
29 void mousePressEvent(QMouseEvent *event);
30 void mouseMoveEvent(QMouseEvent *event);
31 void mouseReleaseEvent(QMouseEvent *event);
32 double curveXfromY(double y);
33 double curveYfromX(double x);
34 private:
35 QLineSeries *curve;
36 QChart *chart;
37 double xmin;
38 double xmax;
39 QGraphicsSimpleTextItem *pointerLabel;
40 QGraphicsLineItem *vLine;
41 QGraphicsSimpleTextItem *vLabel;
42 };
43
44 #endif // PLOT_H

  ViewVC Help
Powered by ViewVC 1.1.26