Loading...
Searching...
No Matches
datapointjs.h
Go to the documentation of this file.
#pragma once
/////////////////////// stdlib includes
/////////////////////// Qt includes
#include <QObject>
#include <QtQml>
/////////////////////// Local includes
#include "jsclassregistrar.h"
#include "pappsomspp/export-import-config.h"
#include "../trace/datapoint.h"
namespace pappso
{
/* BEGIN CLASS JS REFERENCE
* namespace: pappso
* class name: DataPoint
*/
class PMSPP_LIB_DECL DataPointJs : public QObject
{
Q_OBJECT
Q_PROPERTY(double x READ getX WRITE setX NOTIFY xChanged)
Q_PROPERTY(double y READ getY WRITE setY NOTIFY yChanged)
Q_PROPERTY(bool valid READ isValid NOTIFY validChanged)
Q_PROPERTY(QString string READ toString NOTIFY stringChanged)
QML_NAMED_ELEMENT(DataPoint)
public:
Q_INVOKABLE explicit DataPointJs(QObject *parent = nullptr);
Q_INVOKABLE explicit DataPointJs(double x, double y, QObject *parent = nullptr);
Q_INVOKABLE explicit DataPointJs(const DataPoint &data_ppoint, QObject *parent = nullptr);
Q_INVOKABLE double getX() const;
Q_INVOKABLE void setX(double x);
Q_INVOKABLE double getY() const;
Q_INVOKABLE void setY(double y);
Q_INVOKABLE void setData(double x, double y);
bool isValid() const;
QString toString() const;
QString toString(int decimals) const;
Q_INVOKABLE void reset();
Q_INVOKABLE void incrementX(double value);
Q_INVOKABLE void incrementY(double value);
Q_INVOKABLE void initialize(double x, double y);
Q_INVOKABLE void initialize(const QString &text);
const DataPoint &dataPoint() const;
void setDataPoint(const DataPoint &point);
static void registerJsConstructor(QJSEngine *engine);
signals:
void xChanged();
void yChanged();
void validChanged();
void stringChanged();
private:
DataPoint m_dataPoint;
};
PAPPSO_REGISTER_JS_CLASS(pappso, DataPointJs)
/* BEGIN CLASS JS REFERENCE
* namespace: pappso
* class name: DataPoint
*/
} // namespace pappso
pappso::DataPointJs::validChanged
void validChanged()
pappso::DataPointJs::getX
Q_INVOKABLE double getX() const
Definition datapointjs.cpp:34
pappso::DataPointJs::toString
QString toString() const
Definition datapointjs.cpp:72
pappso::DataPointJs::yChanged
void yChanged()
pappso::DataPointJs::reset
Q_INVOKABLE void reset()
Definition datapointjs.cpp:84
pappso::DataPointJs::setX
Q_INVOKABLE void setX(double x)
Definition datapointjs.cpp:22
pappso::DataPointJs::setY
Q_INVOKABLE void setY(double y)
Definition datapointjs.cpp:41
pappso::DataPointJs::setDataPoint
void setDataPoint(const DataPoint &point)
Definition datapointjs.cpp:138
pappso::DataPointJs::DataPointJs
Q_INVOKABLE DataPointJs(QObject *parent=nullptr)
Definition datapointjs.cpp:8
pappso::DataPointJs::stringChanged
void stringChanged()
pappso::DataPointJs::dataPoint
const DataPoint & dataPoint() const
Definition datapointjs.cpp:132
pappso::DataPointJs::setData
Q_INVOKABLE void setData(double x, double y)
Definition datapointjs.cpp:59
pappso::DataPointJs::m_dataPoint
DataPoint m_dataPoint
Definition datapointjs.h:70
pappso::DataPointJs::y
double y
Definition datapointjs.h:29
pappso::DataPointJs::incrementY
Q_INVOKABLE void incrementY(double value)
Definition datapointjs.cpp:102
pappso::DataPointJs::incrementX
Q_INVOKABLE void incrementX(double value)
Definition datapointjs.cpp:94
pappso::DataPointJs::xChanged
void xChanged()
pappso::DataPointJs::getY
Q_INVOKABLE double getY() const
Definition datapointjs.cpp:53
pappso::DataPointJs::registerJsConstructor
static void registerJsConstructor(QJSEngine *engine)
Definition datapointjs.cpp:148
pappso::DataPointJs::x
double x
Definition datapointjs.h:28
pappso::DataPointJs::isValid
bool isValid() const
Definition datapointjs.cpp:66
pappso::DataPointJs::valid
bool valid
Definition datapointjs.h:30
pappso::DataPointJs::initialize
Q_INVOKABLE void initialize(double x, double y)
Definition datapointjs.cpp:110
datapoint.h
export-import-config.h
PMSPP_LIB_DECL
#define PMSPP_LIB_DECL
Definition export-import-config.h:14
jsclassregistrar.h
PAPPSO_REGISTER_JS_CLASS
#define PAPPSO_REGISTER_JS_CLASS(NS_IDENT, CLASS_NAME)
Definition jsclassregistrar.h:35
pappso
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39
pappso::DataPoint
Definition datapoint.h:22