BigBlueBox
An Inventory Management System for a NYLT Course or other Boy Scout Programs
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Pages
windowdragger.h
Go to the documentation of this file.
1 /*
2 ###############################################################################
3 # #
4 # The MIT License #
5 # #
6 # Copyright (C) 2017 by Juergen Skrotzky (JorgenVikingGod@gmail.com) #
7 # >> https://github.com/Jorgen-VikingGod #
8 # #
9 # Sources: https://github.com/Jorgen-VikingGod/Qt-Frameless-Window-DarkStyle #
10 # #
11 ###############################################################################
12 */
13 
14 #ifndef WINDOWDRAGGER_H
15 #define WINDOWDRAGGER_H
16 
17 #include <QWidget>
18 #include <QMouseEvent>
19 
20 class WindowDragger : public QWidget
21 {
22  Q_OBJECT
23 
24 public:
25  explicit WindowDragger(QWidget *parent = 0);
26 
27 signals:
28  void doubleClicked();
29 
30 protected:
31  void mousePressEvent(QMouseEvent *event);
32  void mouseMoveEvent(QMouseEvent *event);
33  void mouseReleaseEvent(QMouseEvent *event);
34  void mouseDoubleClickEvent(QMouseEvent *event);
35  void paintEvent(QPaintEvent *event);
36 
37 protected:
39  QPoint mousePos;
40  QPoint wndPos;
41 };
42 
43 #endif // WINDOWDRAGGER_H
QPoint mousePos
Definition: windowdragger.h:39
void mousePressEvent(QMouseEvent *event)
Definition: windowdragger.cpp:23
void mouseReleaseEvent(QMouseEvent *event)
Definition: windowdragger.cpp:46
void doubleClicked()
Definition: windowdragger.h:20
void mouseMoveEvent(QMouseEvent *event)
Definition: windowdragger.cpp:36
QPoint wndPos
Definition: windowdragger.h:40
void mouseDoubleClickEvent(QMouseEvent *event)
Definition: windowdragger.cpp:61
bool mousePressed
Definition: windowdragger.h:38
void paintEvent(QPaintEvent *event)
Definition: windowdragger.cpp:52
WindowDragger(QWidget *parent=0)
Definition: windowdragger.cpp:18