35 lines
539 B
C++
35 lines
539 B
C++
#ifndef PAINTY_H
|
|
#define PAINTY_H
|
|
|
|
#include <QQuickPaintedItem>
|
|
#include <QVariant>
|
|
#include <QObject>
|
|
#include <vector>
|
|
|
|
class Painty : public QQuickPaintedItem {
|
|
|
|
Q_OBJECT
|
|
|
|
//Q_PROPERTY(QVariant valX WRITE setX)
|
|
//Q_PROPERTY(QVariant valY WRITE setY)
|
|
|
|
|
|
|
|
std::vector<QPointF> points;
|
|
double sigma = 10;
|
|
|
|
public:
|
|
|
|
Painty();
|
|
void paint(QPainter *painter) override;
|
|
|
|
Q_INVOKABLE void setXY(int idx, float x, float y);
|
|
Q_INVOKABLE void setSigma(double s);
|
|
|
|
// void setX(QVariant v);
|
|
// void setY(QVariant v);
|
|
|
|
};
|
|
|
|
#endif // PAINTY_H
|