Tulip  5.1.0
Large graphs analysis and drawing
DragHandle.h
1 /*
2  *
3  * This file is part of Tulip (http://tulip.labri.fr)
4  *
5  * Authors: David Auber and the Tulip development Team
6  * from LaBRI, University of Bordeaux
7  *
8  * Tulip is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU Lesser General Public License
10  * as published by the Free Software Foundation, either version 3
11  * of the License, or (at your option) any later version.
12  *
13  * Tulip is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  * See the GNU General Public License for more details.
17  *
18  */
19 ///@cond DOXYGEN_HIDDEN
20 
21 
22 #ifndef _DRAGHANDLE_H
23 #define _DRAGHANDLE_H
24 
25 #include <QLabel>
26 
27 namespace tlp {
28 
29 class WorkspacePanel;
30 
31 class DragHandle : public QLabel {
32  Q_OBJECT
33 public:
34  explicit DragHandle(QWidget* parent = NULL, Qt::WindowFlags f = 0);
35  virtual void mousePressEvent(QMouseEvent* ev);
36  virtual void mouseReleaseEvent(QMouseEvent* ev);
37  virtual void mouseMoveEvent(QMouseEvent* ev);
38 
39  void setPanel(tlp::WorkspacePanel* panel);
40 
41 private:
42  tlp::WorkspacePanel* _panel;
43  bool _pressed;
44  QPoint _clickPosition;
45 };
46 
47 }
48 #endif //_DRAGHANDLE_H
49 ///@endcond