-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathhandle.cpp
More file actions
35 lines (34 loc) · 841 Bytes
/
handle.cpp
File metadata and controls
35 lines (34 loc) · 841 Bytes
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
#include "handle.h"
#include <QPainter>
Handle::Handle(QPointF pos,int size ,HandleShape shape ,HandleType type) : mPos(pos),mType(type) ,mShape(shape),mSize(size)
{
this->mRect.setRect(pos.x()-size/2,pos.y()-size/2,size,size);
}
QRectF Handle::boundingRect() const {
return mRect;
}
void Handle::setShape(HandleShape shape) {
this->mShape = shape;
}
void Handle::setType(HandleType type) {
this->mType = type;
}
Handle::HandleType Handle::type() {
return this->mType;
}
Handle::HandleShape Handle::shape() {
return this->mShape;
}
void Handle::setSize(int size) {
this->mSize = size;
}
int Handle::size() {
return this->mSize;
}
void Handle::setPos(QPointF pos) {
this->mRect.setRect(pos.x()-mSize/2,pos.y()-mSize/2,mSize,mSize);
this->mPos = pos;
}
QPointF Handle::pos() {
return this->mPos;
}