ImageSel Pile   version 0.0.1
ImageSel pile.
activegrip.h
1 
10 #ifndef GUARD_ACTIVEGRIP_H_INCLUDE
11 #define GUARD_ACTIVEGRIP_H_INCLUDE
12 
13 #include <imagesel/imagesel-config.h>
14 #include <QWidget>
15 
16 class ImageSel;
17 
19 class IMAGESEL_EXPORT ActiveGrip : public QWidget {
20 
21  enum State {
22  GST_NONE = 0,
23 
24  GST_HOVER = 0x0001,
25  GST_CLICKED = 0x0002,
26 
27  GST_ALL = GST_HOVER | GST_CLICKED
28  };
29 
30 public:
31 
33  ActiveGrip (ImageSel * parent);
34 
36  virtual ~ActiveGrip ();
37 
39  inline int
40  getGripSize () const {
41  return minimumSize().width();
42  }
43 
45  inline void
46  setGripSize (int value) {
47  setMinimumSize (value, value);
48  setMaximumSize (value, value);
49  }
50 
52  ImageSel *
53  parentSel () const;
54 
55 protected:
56 
57  void enterEvent (QEvent *);
58  void leaveEvent (QEvent *);
59  void mousePressEvent (QMouseEvent *);
60  void mouseReleaseEvent (QMouseEvent *);
61  void mouseMoveEvent (QMouseEvent *);
62  void paintEvent (QPaintEvent *);
63 
64 private:
65  QPoint offset_;
66  int flags_;
67 };
68 
69 #endif // GUARD_ACTIVEGRIP_H_INCLUDE
void setGripSize(int value)
Set GripSize.
Definition: activegrip.h:46
brief description
Definition: activegrip.h:19
brief description
Definition: imagesel.h:20
int getGripSize() const
Retreive GripSize.
Definition: activegrip.h:40