Loading...
Searching...
No Matches
pappso::DataPointJs Class Reference

`#include <datapointjs.h>`

Inheritance diagram for pappso::DataPointJs:

## Signals

void | xChanged ()
void | yChanged ()
void | validChanged ()
void | stringChanged ()

## Public Member Functions

Q_INVOKABLE | DataPointJs (QObject *parent=nullptr)
Q_INVOKABLE | DataPointJs (double x, double y, QObject *parent=nullptr)
Q_INVOKABLE | 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 Public Member Functions

static void | registerJsConstructor (QJSEngine *engine)

## Properties

double | x
double | y
bool | valid
QString | string

## Private Attributes

DataPoint | m_dataPoint

## Detailed Description

Definition at line 24 of file datapointjs.h.

## Constructor & Destructor Documentation

## DataPointJs() [1/3]

pappso::DataPointJs::DataPointJs | ( | QObject * | parent = nullptr | ) |

explicit

Definition at line 8 of file datapointjs.cpp.

: QObject(parent), m_dataPoint()
{
}
pappso::DataPointJs::m_dataPoint
DataPoint m_dataPoint
Definition datapointjs.h:70

References m_dataPoint.

## DataPointJs() [2/3]

pappso::DataPointJs::DataPointJs | ( | double | x,
|  | double | y,
|  | QObject * | parent = nullptr )

explicit

Definition at line 12 of file datapointjs.cpp.

: QObject(parent), m_dataPoint(x, y)
{
}
pappso::DataPointJs::y
double y
Definition datapointjs.h:29
pappso::DataPointJs::x
double x
Definition datapointjs.h:28

References m_dataPoint, x, and y.

## DataPointJs() [3/3]

pappso::DataPointJs::DataPointJs | ( | const DataPoint & | data_ppoint,
|  | QObject * | parent = nullptr )

explicit

Definition at line 16 of file datapointjs.cpp.

: QObject(parent), m_dataPoint(data_ppoint)
{
}

References m_dataPoint.

## Member Function Documentation

## dataPoint()

const DataPoint & pappso::DataPointJs::dataPoint | ( |  | ) | const

Definition at line 132 of file datapointjs.cpp.

{
return m_dataPoint;
}

References m_dataPoint.

Referenced by pappso::TraceJs::append().

## getX()

double pappso::DataPointJs::getX | ( |  | ) | const

Definition at line 34 of file datapointjs.cpp.

{
return m_dataPoint.x;
}

References m_dataPoint.

## getY()

double pappso::DataPointJs::getY | ( |  | ) | const

Definition at line 53 of file datapointjs.cpp.

{
return m_dataPoint.y;
}

References m_dataPoint.

## incrementX()

void pappso::DataPointJs::incrementX | ( | double | value | ) |

Definition at line 94 of file datapointjs.cpp.

{
m_dataPoint.incrementX(value);
emit xChanged();
emit stringChanged();
}
pappso::DataPointJs::stringChanged
void stringChanged()
pappso::DataPointJs::xChanged
void xChanged()

References m_dataPoint, stringChanged(), and xChanged().

## incrementY()

void pappso::DataPointJs::incrementY | ( | double | value | ) |

Definition at line 102 of file datapointjs.cpp.

{
m_dataPoint.incrementY(value);
emit yChanged();
emit stringChanged();
}
pappso::DataPointJs::yChanged
void yChanged()

References m_dataPoint, stringChanged(), and yChanged().

## initialize() [1/2]

void pappso::DataPointJs::initialize | ( | const QString & | text | ) |

Definition at line 120 of file datapointjs.cpp.

{
if(m_dataPoint.initialize(text))
{
emit xChanged();
emit yChanged();
emit validChanged();
emit stringChanged();
}
}
pappso::DataPointJs::validChanged
void validChanged()

References m_dataPoint, stringChanged(), validChanged(), xChanged(), and yChanged().

## initialize() [2/2]

void pappso::DataPointJs::initialize | ( | double | x,
|  | double | y )

Definition at line 110 of file datapointjs.cpp.

{
m_dataPoint.initialize(x, y);
emit xChanged();
emit yChanged();
emit validChanged();
emit stringChanged();
}

References m_dataPoint, stringChanged(), validChanged(), x, xChanged(), y, and yChanged().

## isValid()

bool pappso::DataPointJs::isValid | ( |  | ) | const

Definition at line 66 of file datapointjs.cpp.

{
return m_dataPoint.isValid();
}

References m_dataPoint.

## registerJsConstructor()

void pappso::DataPointJs::registerJsConstructor | ( | QJSEngine * | engine | ) |

static

Definition at line 148 of file datapointjs.cpp.

{
if(!engine)
{
qWarning() << "Cannot register DataPointJs class: engine is null";
return;
}
// Register the meta object as a constructor
QJSValue jsMetaObject = engine->newQMetaObject(&DataPointJs::staticMetaObject);
engine->globalObject().setProperty("DataPoint", jsMetaObject);
}

## reset()

void pappso::DataPointJs::reset | ( |  | ) |

Definition at line 84 of file datapointjs.cpp.

{
m_dataPoint.reset();
emit xChanged();
emit yChanged();
emit stringChanged();
emit validChanged();
}

References m_dataPoint, stringChanged(), validChanged(), xChanged(), and yChanged().

## setData()

void pappso::DataPointJs::setData | ( | double | x,
|  | double | y )

Definition at line 59 of file datapointjs.cpp.

{
setX(x);
setY(y);
}
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

References setX(), setY(), x, and y.

## setDataPoint()

void pappso::DataPointJs::setDataPoint | ( | const DataPoint & | point | ) |

Definition at line 138 of file datapointjs.cpp.

{
m_dataPoint = point;
emit xChanged();
emit yChanged();
emit validChanged();
emit stringChanged();
}

References m_dataPoint, stringChanged(), validChanged(), xChanged(), and yChanged().

## setX()

void pappso::DataPointJs::setX | ( | double | x | ) |

Definition at line 22 of file datapointjs.cpp.

{
if(m_dataPoint.x != x)
{
m_dataPoint.x = x;
emit xChanged();
emit stringChanged();
emit validChanged();
}
}

References m_dataPoint, stringChanged(), validChanged(), x, and xChanged().

Referenced by setData().

## setY()

void pappso::DataPointJs::setY | ( | double | y | ) |

Definition at line 41 of file datapointjs.cpp.

{
if(m_dataPoint.y != y)
{
m_dataPoint.y = y;
emit yChanged();
emit stringChanged();
emit validChanged();
}
}

References m_dataPoint, stringChanged(), validChanged(), y, and yChanged().

Referenced by setData().

## stringChanged

void pappso::DataPointJs::stringChanged | ( |  | ) |

signal

References stringChanged().

Referenced by incrementX(), incrementY(), initialize(), initialize(), reset(), setDataPoint(), setX(), setY(), and stringChanged().

## toString() [1/2]

QString pappso::DataPointJs::toString | ( |  | ) | const

Definition at line 72 of file datapointjs.cpp.

{
return m_dataPoint.toString();
}

References m_dataPoint.

## toString() [2/2]

QString pappso::DataPointJs::toString | ( | int | decimals | ) | const

Definition at line 78 of file datapointjs.cpp.

{
return m_dataPoint.toString(decimals);
}

References m_dataPoint.

## validChanged

void pappso::DataPointJs::validChanged | ( |  | ) |

signal

References validChanged().

Referenced by initialize(), initialize(), reset(), setDataPoint(), setX(), setY(), and validChanged().

## xChanged

void pappso::DataPointJs::xChanged | ( |  | ) |

signal

References xChanged().

Referenced by incrementX(), initialize(), initialize(), reset(), setDataPoint(), setX(), and xChanged().

## yChanged

void pappso::DataPointJs::yChanged | ( |  | ) |

signal

References yChanged().

Referenced by incrementY(), initialize(), initialize(), reset(), setDataPoint(), setY(), and yChanged().

## Member Data Documentation

## m_dataPoint

DataPoint pappso::DataPointJs::m_dataPoint

private

Definition at line 70 of file datapointjs.h.

Referenced by DataPointJs(), DataPointJs(), DataPointJs(), dataPoint(), getX(), getY(), incrementX(), incrementY(), initialize(), initialize(), isValid(), reset(), setDataPoint(), setX(), setY(), toString(), and toString().

## Property Documentation

## string

QString pappso::DataPointJs::string

read

Definition at line 31 of file datapointjs.h.

## valid

bool pappso::DataPointJs::valid

read

Definition at line 30 of file datapointjs.h.

## x

double pappso::DataPointJs::x

read write

Definition at line 28 of file datapointjs.h.

Referenced by DataPointJs(), initialize(), setData(), and setX().

## y

double pappso::DataPointJs::y

read write

Definition at line 29 of file datapointjs.h.

Referenced by DataPointJs(), initialize(), setData(), and setY().

The documentation for this class was generated from the following files:

- pappsomspp/core/js_qml/datapointjs.h
- pappsomspp/core/js_qml/datapointjs.cpp