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 //=========================================================================================================
108 void mouseMoveEvent(QMouseEvent *event);
109
110 //=========================================================================================================
114 void mousePressEvent(QMouseEvent *event);
115
116 //=========================================================================================================
120 void mouseReleaseEvent(QMouseEvent *event);
121
122 //=========================================================================================================
126 void resizeEvent(QResizeEvent *event);
127
128 //=========================================================================================================
136 QRegion roundedRect(const QRect& rect, int r);
137
138private:
139 QPoint m_dragPosition;
140 bool m_bRoundEdges;
141 bool m_bDraggable;
142 bool m_bMousePressed;
143};
144} // NAMESPACE DISPLIB
145
146#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