v2.0.0
Loading...
Searching...
No Matches
draggableframelesswidget.h
Go to the documentation of this file.
1//=============================================================================================================
22
23#ifndef DRAGGABLEFRAMELESSWIDGET_H
24#define DRAGGABLEFRAMELESSWIDGET_H
25
26//=============================================================================================================
27// INCLUDES
28//=============================================================================================================
29
30#include "../../disp_global.h"
31
32//=============================================================================================================
33// QT INCLUDES
34//=============================================================================================================
35
36#include <QWidget>
37
38//=============================================================================================================
39// EIGEN INCLUDES
40//=============================================================================================================
41
42//=============================================================================================================
43// FORWARD DECLARATIONS
44//=============================================================================================================
45
46//=============================================================================================================
47// DEFINE NAMESPACE DISPLIB
48//=============================================================================================================
49
50namespace DISPLIB
51{
52
53//=============================================================================================================
54// DISPLIB FORWARD DECLARATIONS
55//=============================================================================================================
56
57//=============================================================================================================
66{
67 Q_OBJECT
68
69public:
70 typedef QSharedPointer<DraggableFramelessWidget> SPtr;
71 typedef QSharedPointer<const DraggableFramelessWidget> ConstSPtr;
72
73 //=========================================================================================================
83 DraggableFramelessWidget(QWidget* parent = 0,
84 Qt::WindowFlags flags = Qt::Window,
85 bool bRoundEdges = false,
86 bool bDraggable = true,
87 bool bFrameless = true);
88
89 //=========================================================================================================
94
95 //=========================================================================================================
101 void setDraggable(bool bFlag);
102
103protected:
104 //=========================================================================================================
110 void mouseMoveEvent(QMouseEvent* event);
111
112 //=========================================================================================================
118 void mousePressEvent(QMouseEvent* event);
119
120 //=========================================================================================================
126 void mouseReleaseEvent(QMouseEvent* event);
127
128 //=========================================================================================================
134 void resizeEvent(QResizeEvent* event);
135
136 //=========================================================================================================
144 QRegion roundedRect(const QRect& rect, int r);
145
146private:
147 QPoint m_dragPosition;
148 bool m_bRoundEdges;
149 bool m_bDraggable;
150 bool m_bMousePressed;
151};
152} // NAMESPACE DISPLIB
153
154#endif // DRAGGABLEFRAMELESSWIDGET_H
Export macros and build-info hooks for the DISPLIB shared library.
#define DISPSHARED_EXPORT
Definition disp_global.h:38
2-D display widgets and visualisation helpers (charts, topography, colour maps).
QSharedPointer< DraggableFramelessWidget > SPtr
QRegion roundedRect(const QRect &rect, int r)
DraggableFramelessWidget(QWidget *parent=0, Qt::WindowFlags flags=Qt::Window, bool bRoundEdges=false, bool bDraggable=true, bool bFrameless=true)
QSharedPointer< const DraggableFramelessWidget > ConstSPtr