Medical Imaging Interaction Toolkit  2024.06.00
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 QmitkCrossWidget_h
14 #define QmitkCrossWidget_h
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 = {});
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
MITKQTWIDGETSEXT_EXPORT
#define MITKQTWIDGETSEXT_EXPORT
Definition: MitkQtWidgetsExtExports.h:15
QmitkCrossWidget
Definition: QmitkCrossWidget.h:21
mitkCommon.h
QmitkCrossWidget::lastY
int lastY
Definition: QmitkCrossWidget.h:44
QmitkCrossWidget::ResetMousePosition
void ResetMousePosition(int xpos, int ypos)
Definition: QmitkCrossWidget.h:41
MitkQtWidgetsExtExports.h