You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
vmprofiler-qt/src/darkstyle/framelesswindow/windowdragger.h

44 lines
1.4 KiB

/*
###############################################################################
# #
# The MIT License #
# #
# Copyright (C) 2017 by Juergen Skrotzky (JorgenVikingGod@gmail.com) #
# >> 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