-
Notifications
You must be signed in to change notification settings - Fork 11
/
drawablecell.h
42 lines (32 loc) · 953 Bytes
/
drawablecell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef DRAWABLECELL_H
#define DRAWABLECELL_H
#include <QQuickPaintedItem>
#include <QImage>
class DrawableCell : public QQuickPaintedItem
{
Q_OBJECT
Q_PROPERTY(QString recognized READ recognized NOTIFY recognizedChanged)
public:
DrawableCell();
void paint(QPainter *painter) override;
signals:
void recognizedChanged();
public slots:
const QString &recognized() const { return m_recognized; }
protected:
void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
// hack around crappy stylus/tablet support in qt 5.6
#if (QT_VERSION < QT_VERSION_CHECK(5, 7, 0))
public:
#endif
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mouseReleaseEvent(QMouseEvent *event) override;
private:
QPointF m_lastPoint;
QString m_recognized;
QImage m_drawn;
// QObject interface
public:
};
#endif // DRAWABLECELL_H