-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathstickynote.h
41 lines (30 loc) · 997 Bytes
/
stickynote.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
#ifndef STICKYNOTE_H
#define STICKYNOTE_H
#include <QGraphicsItem>
#include <staffGamesConstants.h>
#include "stickyline.h"
class StickyNote;
#include "stickynotesignalhandler.h"
class StickyNote : public QGraphicsItem
{
public:
//StickyNote();
//StickyNote(QPoint x, QPoint y);
StickyNote(QRectF);
//StickyNote(int, int, int, int);
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void setSignalHandler(StickyNoteSignalHandler* handler);
protected:
void mousePressEvent(QGraphicsSceneMouseEvent *event);
void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
bool collidesWithItem(const QGraphicsItem *other, Qt::ItemSelectionMode mode) const;
private:
QLineF makeStem();
void checkBounds();
QRectF m_rec;
bool m_isMousePressed;
StickyNoteSignalHandler* m_signalHandler;
};
#endif // STICKYNOTE_H