35 #if QT_VERSION < 0x050000
36 #include <QDeclarativeItem>
38 #include <QQuickPaintedItem>
48 #if QT_VERSION < 0x050000
56 Q_PROPERTY (
QList<QPointF> points READ GetPoints WRITE SetPoints NOTIFY pointsChanged)
58 Q_PROPERTY (QVariant multipoints READ GetMultipoints WRITE SetMultipoints NOTIFY multipointsChanged)
60 Q_PROPERTY (
double minXValue READ GetMinXValue WRITE SetMinXValue NOTIFY minXValueChanged)
61 Q_PROPERTY (
double maxXValue READ GetMaxXValue WRITE SetMaxXValue NOTIFY maxXValueChanged)
62 Q_PROPERTY (
double minYValue READ GetMinYValue WRITE SetMinYValue NOTIFY minYValueChanged)
63 Q_PROPERTY (
double maxYValue READ GetMaxYValue WRITE SetMaxYValue NOTIFY maxYValueChanged)
65 Q_PROPERTY (
bool yGridEnabled READ GetYGridEnabled WRITE SetYGridEnabled NOTIFY yGridChanged)
66 Q_PROPERTY (
bool yMinorGridEnabled READ GetYMinorGridEnabled WRITE SetYMinorGridEnabled NOTIFY yMinorGridChanged)
68 Q_PROPERTY (
double alpha READ GetAlpha WRITE SetAlpha NOTIFY alphaChanged)
69 Q_PROPERTY (QColor color READ GetColor WRITE SetColor NOTIFY colorChanged)
70 Q_PROPERTY (
bool leftAxisEnabled READ GetLeftAxisEnabled WRITE SetLeftAxisEnabled NOTIFY leftAxisEnabledChanged)
71 Q_PROPERTY (
bool bottomAxisEnabled READ GetBottomAxisEnabled WRITE SetBottomAxisEnabled NOTIFY bottomAxisEnabledChanged)
72 Q_PROPERTY (QString leftAxisTitle READ GetLeftAxisTitle WRITE SetLeftAxisTitle NOTIFY leftAxisTitleChanged)
73 Q_PROPERTY (QString bottomAxisTitle READ GetBottomAxisTitle WRITE SetBottomAxisTitle NOTIFY bottomAxisTitleChanged)
75 Q_PROPERTY (QString plotTitle READ GetPlotTitle WRITE SetPlotTitle NOTIFY plotTitleChanged)
77 Q_PROPERTY (QColor background READ GetBackground WRITE SetBackground NOTIFY backgroundChanged)
78 Q_PROPERTY (QColor textColor READ GetTextColor WRITE SetTextColor NOTIFY textColorChanged)
79 Q_PROPERTY (QColor gridLinesColor READ GetGridLinesColor WRITE SetGridLinesColor NOTIFY gridLinesColorChanged)
81 Q_PROPERTY (
int xExtent READ GetXExtent NOTIFY extentsChanged)
82 Q_PROPERTY (
int yExtent READ GetYExtent NOTIFY extentsChanged)
93 double MinXValue_ = -1;
94 double MaxXValue_ = -1;
95 double MinYValue_ = -1;
96 double MaxYValue_ = -1;
98 bool YGridEnabled_ =
false;
99 bool YMinorGridEnabled_ =
false;
105 bool LeftAxisEnabled_ =
false;
106 bool BottomAxisEnabled_ =
false;
122 #if QT_VERSION < 0x050000
131 QVariant GetMultipoints ()
const;
132 void SetMultipoints (
const QVariant&);
134 double GetMinXValue ()
const;
135 void SetMinXValue (
double);
136 double GetMaxXValue ()
const;
137 void SetMaxXValue (
double);
138 double GetMinYValue ()
const;
139 void SetMinYValue (
double);
140 double GetMaxYValue ()
const;
141 void SetMaxYValue (
double);
143 bool GetYGridEnabled ()
const;
144 void SetYGridEnabled (
bool);
145 bool GetYMinorGridEnabled ()
const;
146 void SetYMinorGridEnabled (
bool);
148 double GetAlpha ()
const;
149 void SetAlpha (
double);
151 QColor GetColor ()
const;
152 void SetColor (
const QColor&);
154 bool GetLeftAxisEnabled ()
const;
155 void SetLeftAxisEnabled (
bool);
156 bool GetBottomAxisEnabled ()
const;
157 void SetBottomAxisEnabled (
bool);
159 QString GetLeftAxisTitle ()
const;
160 void SetLeftAxisTitle (
const QString&);
161 QString GetBottomAxisTitle ()
const;
162 void SetBottomAxisTitle (
const QString&);
164 QString GetPlotTitle ()
const;
165 void SetPlotTitle (
const QString&);
167 QColor GetBackground ()
const;
168 void SetBackground (
const QColor&);
169 QColor GetTextColor ()
const;
170 void SetTextColor (
const QColor&);
171 QColor GetGridLinesColor ()
const;
172 void SetGridLinesColor (
const QColor&);
174 int GetXExtent ()
const;
175 int GetYExtent ()
const;
177 #if QT_VERSION < 0x050000
178 void paint (QPainter*,
const QStyleOptionGraphicsItem*, QWidget*)
override;
180 void paint (QPainter*)
override;
184 void SetNewValue (T val, T& ourVal,
const std::function<
void ()>& notifier);
186 int CalcXExtent (QwtPlot&)
const;
187 int CalcYExtent (QwtPlot&)
const;
189 void pointsChanged ();
190 void multipointsChanged ();
192 void minXValueChanged ();
193 void maxXValueChanged ();
194 void minYValueChanged ();
195 void maxYValueChanged ();
197 void yGridChanged ();
198 void yMinorGridChanged ();
200 void alphaChanged ();
202 void colorChanged ();
204 void leftAxisEnabledChanged ();
205 void bottomAxisEnabledChanged ();
207 void leftAxisTitleChanged ();
208 void bottomAxisTitleChanged ();
210 void plotTitleChanged ();
212 void backgroundChanged ();
213 void textColorChanged ();
214 void gridLinesColorChanged ();
216 void extentsChanged ();
QList< PointsSet > Multipoints_
std::shared_ptr< QwtPlot > Plot_