-
-
Notifications
You must be signed in to change notification settings - Fork 557
/
Copy pathgroupbox.cpp
45 lines (34 loc) · 925 Bytes
/
groupbox.cpp
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
43
44
// This file is a part of "grblControl" application.
// Copyright 2015 Hayrullin Denis Ravilevich
#include <QMouseEvent>
#include <QDebug>
#include <QCheckBox>
#include "groupbox.h"
GroupBox::GroupBox(QWidget *parent) : QGroupBox(parent)
{
}
void GroupBox::mouseMoveEvent(QMouseEvent *event)
{
QGroupBox::mouseMoveEvent(event);
if (!m_pressedPos.isNull()) {
QPoint delta = event->globalPos() - m_pressedPos;
emit mouseMoved(delta.x(), delta.y());
}
}
void GroupBox::mousePressEvent(QMouseEvent *event)
{
QGroupBox::mousePressEvent(event);
m_pressedPos = event->globalPos();
emit mousePressed();
}
void GroupBox::mouseReleaseEvent(QMouseEvent *event)
{
QGroupBox::mouseReleaseEvent(event);
m_pressedPos = QPoint();
emit mouseReleased();
}
void GroupBox::resizeEvent(QResizeEvent *event)
{
QGroupBox::resizeEvent(event);
emit resized(event->size());
}