Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
QmitkCrossWidget.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QMITKTCROSSWIDGET_H_INCLUDED
18 #define QMITKTCROSSWIDGET_H_INCLUDED
19 
21 #include <QLabel>
22 
23 #include <mitkCommon.h>
24 
26 {
27  Q_OBJECT
28 
29 public:
30  QmitkCrossWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
31 
32  void mousePressEvent(QMouseEvent *mouseEvent) override;
33  void mouseMoveEvent(QMouseEvent *mouseEvent) override;
34  void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
35 
36 signals:
37 
38  void SignalDeltaMove(int, int);
39 
40 protected:
41 // fix for bug 3378 - setPos() causes an app crash on MAC OS X
42 #ifdef __APPLE__
43  void ResetMousePosition(int, int){};
44 #else
45  void ResetMousePosition(int xpos, int ypos) { QCursor::setPos(xpos, ypos); };
46 #endif
47 
48  int lastX, lastY;
49 };
50 
51 #endif
#define MITKQTWIDGETSEXT_EXPORT
void ResetMousePosition(int xpos, int ypos)