Medical Imaging Interaction Toolkit  2018.4.99-389bf124
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 (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QMITKTCROSSWIDGET_H_INCLUDED
14 #define QMITKTCROSSWIDGET_H_INCLUDED
15 
17 #include <QLabel>
18 
19 #include <mitkCommon.h>
20 
22 {
23  Q_OBJECT
24 
25 public:
26  QmitkCrossWidget(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr);
27 
28  void mousePressEvent(QMouseEvent *mouseEvent) override;
29  void mouseMoveEvent(QMouseEvent *mouseEvent) override;
30  void mouseReleaseEvent(QMouseEvent *mouseEvent) override;
31 
32 signals:
33 
34  void SignalDeltaMove(int, int);
35 
36 protected:
37 // fix for bug 3378 - setPos() causes an app crash on macOS
38 #ifdef __APPLE__
39  void ResetMousePosition(int, int){};
40 #else
41  void ResetMousePosition(int xpos, int ypos) { QCursor::setPos(xpos, ypos); };
42 #endif
43 
44  int lastX, lastY;
45 };
46 
47 #endif
#define MITKQTWIDGETSEXT_EXPORT
void ResetMousePosition(int xpos, int ypos)