-
Notifications
You must be signed in to change notification settings - Fork 4
/
windowdragger.h
43 lines (35 loc) · 1.38 KB
/
windowdragger.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
43
/*
###############################################################################
# #
# The MIT License #
# #
# Copyright (C) 2017 by Juergen Skrotzky ([email protected]) #
# >> https://github.com/Jorgen-VikingGod #
# #
# Sources: https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyle #
# #
###############################################################################
*/
#ifndef WINDOWDRAGGER_H
#define WINDOWDRAGGER_H
#include <QMouseEvent>
#include <QWidget>
class WindowDragger : public QWidget {
Q_OBJECT
public:
explicit WindowDragger(QWidget *parent = Q_NULLPTR);
virtual ~WindowDragger() {}
signals:
void doubleClicked();
protected:
void mousePressEvent(QMouseEvent *event);
void mouseMoveEvent(QMouseEvent *event);
void mouseReleaseEvent(QMouseEvent *event);
void mouseDoubleClickEvent(QMouseEvent *event);
void paintEvent(QPaintEvent *event);
protected:
QPoint mousePos;
QPoint wndPos;
bool mousePressed;
};
#endif // WINDOWDRAGGER_H