33 #include <QDeclarativeItem>
44 Q_PROPERTY (
QList<QPointF> points READ GetPoints WRITE SetPoints NOTIFY pointsChanged)
46 Q_PROPERTY (QVariant multipoints READ GetMultipoints WRITE SetMultipoints NOTIFY multipointsChanged)
48 Q_PROPERTY (
double minYValue READ GetMinYValue WRITE SetMinYValue NOTIFY minYValueChanged)
49 Q_PROPERTY (
double maxYValue READ GetMaxYValue WRITE SetMaxYValue NOTIFY maxYValueChanged)
51 Q_PROPERTY (
bool yGridEnabled READ GetYGridEnabled WRITE SetYGridEnabled NOTIFY yGridChanged)
52 Q_PROPERTY (
bool yMinorGridEnabled READ GetYMinorGridEnabled WRITE SetYMinorGridEnabled NOTIFY yMinorGridChanged)
54 Q_PROPERTY (
double alpha READ GetAlpha WRITE SetAlpha NOTIFY alphaChanged)
55 Q_PROPERTY (QColor color READ GetColor WRITE SetColor NOTIFY colorChanged)
56 Q_PROPERTY (
bool leftAxisEnabled READ GetLeftAxisEnabled WRITE SetLeftAxisEnabled NOTIFY leftAxisEnabledChanged)
57 Q_PROPERTY (
bool bottomAxisEnabled READ GetBottomAxisEnabled WRITE SetBottomAxisEnabled NOTIFY bottomAxisEnabledChanged)
58 Q_PROPERTY (QString leftAxisTitle READ GetLeftAxisTitle WRITE SetLeftAxisTitle NOTIFY leftAxisTitleChanged)
59 Q_PROPERTY (QString bottomAxisTitle READ GetBottomAxisTitle WRITE SetBottomAxisTitle NOTIFY bottomAxisTitleChanged)
61 Q_PROPERTY (QString plotTitle READ GetPlotTitle WRITE SetPlotTitle NOTIFY plotTitleChanged)
63 Q_PROPERTY (QColor background READ GetBackground WRITE SetBackground NOTIFY backgroundChanged)
64 Q_PROPERTY (QColor textColor READ GetTextColor WRITE SetTextColor NOTIFY textColorChanged)
75 double MinYValue_ = -1;
76 double MaxYValue_ = -1;
78 bool YGridEnabled_ =
false;
79 bool YMinorGridEnabled_ =
false;
85 bool LeftAxisEnabled_ =
false;
86 bool BottomAxisEnabled_ =
false;
88 QString LeftAxisTitle_;
89 QString BottomAxisTitle_;
93 QColor BackgroundColor_;
101 QVariant GetMultipoints ()
const;
102 void SetMultipoints (
const QVariant&);
104 double GetMinYValue ()
const;
105 void SetMinYValue (
double);
106 double GetMaxYValue ()
const;
107 void SetMaxYValue (
double);
109 bool GetYGridEnabled ()
const;
110 void SetYGridEnabled (
bool);
111 bool GetYMinorGridEnabled ()
const;
112 void SetYMinorGridEnabled (
bool);
114 double GetAlpha ()
const;
115 void SetAlpha (
double);
117 QColor GetColor ()
const;
118 void SetColor (
const QColor&);
120 bool GetLeftAxisEnabled ()
const;
121 void SetLeftAxisEnabled (
bool);
122 bool GetBottomAxisEnabled ()
const;
123 void SetBottomAxisEnabled (
bool);
125 QString GetLeftAxisTitle ()
const;
126 void SetLeftAxisTitle (
const QString&);
127 QString GetBottomAxisTitle ()
const;
128 void SetBottomAxisTitle (
const QString&);
130 QString GetPlotTitle ()
const;
131 void SetPlotTitle (
const QString&);
133 QColor GetBackground ()
const;
134 void SetBackground (
const QColor&);
135 QColor GetTextColor ()
const;
136 void SetTextColor (
const QColor&);
138 void paint (QPainter*,
const QStyleOptionGraphicsItem*, QWidget*)
override;
141 void SetNewValue (T val, T& ourVal,
const std::function<
void ()>& notifier);
143 void pointsChanged ();
144 void multipointsChanged ();
146 void minYValueChanged ();
147 void maxYValueChanged ();
149 void yGridChanged ();
150 void yMinorGridChanged ();
152 void alphaChanged ();
154 void colorChanged ();
156 void leftAxisEnabledChanged ();
157 void bottomAxisEnabledChanged ();
159 void leftAxisTitleChanged ();
160 void bottomAxisTitleChanged ();
162 void plotTitleChanged ();
164 void backgroundChanged ();
165 void textColorChanged ();