OpenCurves  0.9
curveproperties.h
1 //
2 // author Kazys Stepanas
3 //
4 // Copyright (c) CSIRO 2015
5 //
6 #ifndef CURVEPROPERTIES_H_
7 #define CURVEPROPERTIES_H_
8 
9 #include "ocurvesconfig.h"
10 
11 #include <QWidget>
12 
13 namespace Ui
14 {
15  class CurveProperties;
16 }
17 
18 class Curves;
19 class PlotInstance;
20 class PlotSource;
21 class QIntValidator;
22 
25 class CurveProperties : public QWidget
26 {
27  Q_OBJECT
28 public:
32  CurveProperties(Curves *curves, QWidget *parent = nullptr);
33 
36 
39  inline PlotInstance *curve() { return _curve; }
40 
43  inline const PlotInstance *curve() const { return _curve; }
44 
45 public slots:
49 
52  void curveChanged(const PlotInstance *curve);
53 
56  void sourceChanged(const PlotSource *source);
57 
58 signals:
62 
63 private slots:
65  void timeColumnChanged();
67  void timeScaleChanged();
69  void timeBaseChanged();
71  void toggleExplicitColour(bool checked);
73  void widthChanged(int width);
75  void styleChanged(int index);
77  void symbolSizeChanged(int width);
79  void symbolChanged(int index);
81  void filterInfChecked(bool checked);
83  void filterNaNChecked(bool checked);
85  void resetCurveProperties();
86 
87 private:
90  void update(PlotInstance *curve);
92  bool eventFilter(QObject *target, QEvent *event) override;
93 
96  void invalidateCurve(PlotInstance &curve);
97 
100  void invalidateSource(PlotSource &source);
101 
105  static void setColour(QWidget *widget, const QColor &colour);
106 
107  Ui::CurveProperties *_ui;
108  Curves *_curves;
109  PlotInstance *_curve;
110  QIntValidator *_timeColumnValidator;
111  bool _suppressEvents;
112 };
113 
114 #endif // CURVEPROPERTIES_H_
void activeCurveChanged(PlotInstance *curve)
Emitted when the active curve changed.
Definition: coloursview.h:16
~CurveProperties()
Destructor.
void setActiveCurve(PlotInstance *curve)
Sets the active curve being edited.
const PlotInstance * curve() const
Access the curve being viewed and edited.
Definition: curveproperties.h:43
void sourceChanged(const PlotSource *source)
Bound to Curves::sourceDataChanged().
Holds data for a single curve.
Definition: plotinstance.h:43
The data model for loaded plots and curves.
Definition: curves.h:36
PlotInstance * curve()
Access the curve being viewed and edited.
Definition: curveproperties.h:39
Provides details about a source from which PlotInstance objects have been generated.
Definition: plotsource.h:28
void curveChanged(const PlotInstance *curve)
Bound to Curves::curveDataChanged().
CurveProperties(Curves *curves, QWidget *parent=nullptr)
Constructor.
UI for editing PlotSource and PlotInstance properties.
Definition: curveproperties.h:25