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

`#include <qpointfjs.h>`

Inheritance diagram for pappso::QPointFJs:

## Signals

void | xChanged ()
void | yChanged ()

## Public Member Functions

Q_INVOKABLE | QPointFJs (QObject *parent=nullptr)
Q_INVOKABLE | QPointFJs (double x, double y, QObject *parent=nullptr)
Q_INVOKABLE | QPointFJs (const QPointF &pointf, QObject *parent=nullptr)
Q_INVOKABLE double | x () const
Q_INVOKABLE void | setX (double x)
Q_INVOKABLE double | y () const
Q_INVOKABLE void | setY (double y)
const QPointF & | point () const
void | setPointF (const QPointF &pointf)

## Static Public Member Functions

static void | registerJsConstructor (QJSEngine *engine)

## Properties

double | x
double | y

## Private Attributes

QPointF | m_pointf

## Detailed Description

Definition at line 24 of file qpointfjs.h.

## Constructor & Destructor Documentation

## QPointFJs() [1/3]

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

explicit

Definition at line 8 of file qpointfjs.cpp.

: QObject(parent), m_pointf()
{
}
pappso::QPointFJs::m_pointf
QPointF m_pointf
Definition qpointfjs.h:52

References m_pointf.

## QPointFJs() [2/3]

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

explicit

Definition at line 12 of file qpointfjs.cpp.

: QObject(parent), m_pointf(x, y)
{
}
pappso::QPointFJs::x
double x
Definition qpointfjs.h:27
pappso::QPointFJs::y
double y
Definition qpointfjs.h:28

References m_pointf, x, and y.

## QPointFJs() [3/3]

pappso::QPointFJs::QPointFJs | ( | const QPointF & | pointf,
|  | QObject * | parent = nullptr )

explicit

Definition at line 16 of file qpointfjs.cpp.

: QObject(parent), m_pointf(pointf)
{
}

References m_pointf.

## Member Function Documentation

## point()

const QPointF & pappso::QPointFJs::point | ( |  | ) | const

Definition at line 54 of file qpointfjs.cpp.

{
return m_pointf;
}

References m_pointf.

## registerJsConstructor()

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

static

Definition at line 68 of file qpointfjs.cpp.

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

## setPointF()

void pappso::QPointFJs::setPointF | ( | const QPointF & | pointf | ) |

Definition at line 60 of file qpointfjs.cpp.

{
m_pointf = pointf;
emit xChanged();
emit yChanged();
}
pappso::QPointFJs::xChanged
void xChanged()
pappso::QPointFJs::yChanged
void yChanged()

References m_pointf, xChanged(), and yChanged().

## setX()

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

Definition at line 21 of file qpointfjs.cpp.

{
if(m_pointf.x() != x)
{
m_pointf.rx() = x;
emit xChanged();
}
}

References m_pointf, x, and xChanged().

## setY()

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

Definition at line 38 of file qpointfjs.cpp.

{
if(m_pointf.y() != y)
{
m_pointf.ry() = y;
emit yChanged();
}
}

References m_pointf, y, and yChanged().

## x()

double pappso::QPointFJs::x | ( |  | ) | const

Definition at line 31 of file qpointfjs.cpp.

{
return m_pointf.x();
}

References m_pointf.

## xChanged

void pappso::QPointFJs::xChanged | ( |  | ) |

signal

References xChanged().

Referenced by setPointF(), setX(), and xChanged().

## y()

double pappso::QPointFJs::y | ( |  | ) | const

Definition at line 48 of file qpointfjs.cpp.

{
return m_pointf.y();
}

References m_pointf.

## yChanged

void pappso::QPointFJs::yChanged | ( |  | ) |

signal

References yChanged().

Referenced by setPointF(), setY(), and yChanged().

## Member Data Documentation

## m_pointf

QPointF pappso::QPointFJs::m_pointf

private

Definition at line 52 of file qpointfjs.h.

Referenced by QPointFJs(), QPointFJs(), QPointFJs(), point(), setPointF(), setX(), setY(), x(), and y().

## Property Documentation

## x

double pappso::QPointFJs::x

read write

Definition at line 27 of file qpointfjs.h.

Referenced by QPointFJs(), and setX().

## y

double pappso::QPointFJs::y

read write

Definition at line 28 of file qpointfjs.h.

Referenced by QPointFJs(), and setY().

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

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