##// END OF EJS Templates
Fix to discard NaN, Inf and -Inf values from chart....
Fix to discard NaN, Inf and -Inf values from chart. This correction adds test to several append funtions to test that NaN, Inf and -Inf values are not added to chart. This solution follows the QPainterPath behaviour. Task-number: QTRD-1893 Reviewed-by: Miikka Heikkinen

File last commit:

r2424:4543a29c8891
r2424:4543a29c8891
Show More
charthelpers_p.h
26 lines | 538 B | text/x-c | CLexer
#ifndef CHARTHELPERS_P_H
#define CHARTHELPERS_P_H
#include <qnumeric.h>
#include <QPointF>
static inline bool isValidValue(qreal value)
{
if (qIsNaN(value) || qIsInf(value)) {
qWarning("Ignored NaN, Inf, or -Inf value.");
return false;
}
return true;
}
static inline bool isValidValue(qreal x, qreal y)
{
return (isValidValue(x) && isValidValue(y));
}
static inline bool isValidValue(const QPointF point)
{
return (isValidValue(point.x()) && isValidValue(point.y()));
}
#endif // CHARTHELPERS_P_H