CustusX  2023.01.05-dev+develop.0da12
An IGT application
cxMousePadWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 
12 
13 /*
14  * sscMousePadWidget.h
15  *
16  * Created on: Jul 25, 2011
17  * Author: christiana
18  */
19 
20 #ifndef CXMOUSEPADWIDGET_H_
21 #define CXMOUSEPADWIDGET_H_
22 
23 #include "cxResourceWidgetsExport.h"
24 
25 #include <QFrame>
26 
27 namespace cx
28 {
29 
35 class cxResourceWidgets_EXPORT MousePadWidgetInternal: public QFrame
36 {
37 Q_OBJECT
38 
39 public:
40  MousePadWidgetInternal(QWidget* parent, QSize minimumSize);
41  virtual ~MousePadWidgetInternal();
42  void setFixedXPos(bool on);
43  void setFixedYPos(bool on);
44  virtual QSize minimumSizeHint() const
45  {
46  return mMinSize;
47  }
48 signals:
49  void mouseMoved(QPointF deltaN);
50 protected:
51  void paintEvent(QPaintEvent* event);
52  virtual void showEvent(QShowEvent* event);
53  virtual void mouseMoveEvent(QMouseEvent* event);
54  virtual void mousePressEvent(QMouseEvent* event);
55  virtual void mouseReleaseEvent(QMouseEvent* event);
56  virtual void resizeEvent(QResizeEvent* event);
57 
58 private:
59  QPoint mLastPos;
60  bool mFixPosX;
61  bool mFixPosY;
62  QSize mMinSize;
63  void fixPos();
64 };
65 
70 class cxResourceWidgets_EXPORT MousePadWidget: public QFrame
71 {
72 Q_OBJECT
73 
74 public:
75  MousePadWidget(QWidget* parent, QSize minimumSize);
76  virtual ~MousePadWidget();
77  void setFixedXPos(bool on);
78  void setFixedYPos(bool on);
79 signals:
80  void mouseMoved(QPointF deltaN);
81 protected:
82 private:
83  class MousePadWidgetInternal* mInternal;
84 };
85 
86 }
87 
88 #endif /* CXMOUSEPADWIDGET_H_ */
virtual QSize minimumSizeHint() const
A touchpad-friendly area for performing 1D/2D scroll operations.
Namespace for all CustusX production code.