-
Notifications
You must be signed in to change notification settings - Fork 4
/
selectiongroup.h
41 lines (31 loc) · 953 Bytes
/
selectiongroup.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 _SELECTIONGROUP_H_
#define _SELECTIONGROUP_H_
#include <QByteArray>
#include <QGraphicsItemGroup>
#include <QPoint>
#include <QRect>
class Document;
class SparseMap;
class SelectionGroup : public QGraphicsItemGroup
{
public:
static const char* mimeType();
SelectionGroup(Document *doc);
SelectionGroup(Document *doc, const QRect ®ion, bool move = false);
SelectionGroup(Document *doc, const QRect ®ion);
SelectionGroup(Document *doc, const QByteArray &array);
~SelectionGroup();
QPoint position() { return region_.topLeft(); }
const QRect& region() { return region_; }
const SparseMap* map() { return map_; }
void moveTo(const QPoint &p);
void moveRel(const QPoint &delta);
QByteArray serialize() const;
private:
void deserialize(Document *doc, const QByteArray &array);
void initialize(Document *doc, const QRect ®ion, bool move = false);
private:
QRect region_;
SparseMap *map_;
};
#endif