libpappsomspp
Library for mass spectrometry
Loading...
Searching...
No Matches
datapointjs.h
Go to the documentation of this file.
1#pragma once
2
3/////////////////////// stdlib includes
4
5
6/////////////////////// Qt includes
7#include <QObject>
8#include <QtQml>
9
10
11/////////////////////// Local includes
12#include "jsclassregistrar.h"
14#include "../trace/datapoint.h"
15
16namespace pappso
17{
18
19 /* BEGIN CLASS JS REFERENCE
20 * namespace: pappso
21 * class name: DataPoint
22 */
23
24class PMSPP_LIB_DECL DataPointJs : public QObject
25{
26 Q_OBJECT
27
28 Q_PROPERTY(double x READ getX WRITE setX NOTIFY xChanged)
29 Q_PROPERTY(double y READ getY WRITE setY NOTIFY yChanged)
30 Q_PROPERTY(bool valid READ isValid NOTIFY validChanged)
31 Q_PROPERTY(QString string READ toString NOTIFY stringChanged)
32 QML_NAMED_ELEMENT(DataPoint)
33
34 public:
35 Q_INVOKABLE explicit DataPointJs(QObject *parent = nullptr);
36 Q_INVOKABLE explicit DataPointJs(double x, double y, QObject *parent = nullptr);
37 Q_INVOKABLE explicit DataPointJs(const DataPoint &data_ppoint, QObject *parent = nullptr);
38
39 Q_INVOKABLE double getX() const;
40 Q_INVOKABLE void setX(double x);
41
42 Q_INVOKABLE double getY() const;
43 Q_INVOKABLE void setY(double y);
44
45 Q_INVOKABLE void setData(double x, double y);
46
47 bool isValid() const;
48
49 QString toString() const;
50 QString toString(int decimals) const;
51
52 Q_INVOKABLE void reset();
53 Q_INVOKABLE void incrementX(double value);
54 Q_INVOKABLE void incrementY(double value);
55 Q_INVOKABLE void initialize(double x, double y);
56 Q_INVOKABLE void initialize(const QString &text);
57
58 const DataPoint &dataPoint() const;
59 void setDataPoint(const DataPoint &point);
60
61 static void registerJsConstructor(QJSEngine *engine);
62
63 signals:
64 void xChanged();
65 void yChanged();
68
69 private:
71};
72
74
75 /* BEGIN CLASS JS REFERENCE
76 * namespace: pappso
77 * class name: DataPoint
78 */
79
80} // namespace pappso
Q_INVOKABLE double getX() const
QString toString() const
Q_INVOKABLE void reset()
Q_INVOKABLE void setX(double x)
Q_INVOKABLE void setY(double y)
void setDataPoint(const DataPoint &point)
Q_INVOKABLE DataPointJs(QObject *parent=nullptr)
const DataPoint & dataPoint() const
Q_INVOKABLE void setData(double x, double y)
DataPoint m_dataPoint
Definition datapointjs.h:70
Q_INVOKABLE void incrementY(double value)
Q_INVOKABLE void incrementX(double value)
Q_INVOKABLE double getY() const
static void registerJsConstructor(QJSEngine *engine)
bool isValid() const
Q_INVOKABLE void initialize(double x, double y)
#define PMSPP_LIB_DECL
#define PAPPSO_REGISTER_JS_CLASS(NS_IDENT, CLASS_NAME)
tries to keep as much as possible monoisotopes, removing any possible C13 peaks and changes multichar...
Definition aa.cpp:39