Medical Imaging Interaction Toolkit  2025.08.99-f7084adb
Medical Imaging Interaction Toolkit
QmitkOverlayWidget.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 QmitkOverlayWidget_h
14 #define QmitkOverlayWidget_h
15 
16 #include <QWidget>
17 
18 #include <MitkQtWidgetsExports.h>
19 
24 {
25  Q_OBJECT
26  Q_PROPERTY(bool transparentForMouseEvents READ isTransparentForMouseEvents WRITE setTransparentForMouseEvents)
27 
28 public:
29  explicit QmitkOverlayWidget(QWidget* parent = nullptr);
30  ~QmitkOverlayWidget() override;
31 
32  bool isTransparentForMouseEvents() const;
33  void setTransparentForMouseEvents(bool transparent = true);
34 
35  int getOpacity() const;
36 
37 public slots:
38  void setOpacity(int opacity);
39 
40 protected:
41  bool event(QEvent* e) override;
42  bool eventFilter(QObject* watched, QEvent* event) override;
43  void paintEvent(QPaintEvent* event) override;
44 
45 private:
46  void installEventFilterOnParent();
47  void removeEventFilterFromParent();
48 
49  int m_Opacity = 63;
50 
51 };
52 
53 #endif
MITKQTWIDGETS_EXPORT
#define MITKQTWIDGETS_EXPORT
Definition: MitkQtWidgetsExports.h:15
QmitkOverlayWidget
Definition: QmitkOverlayWidget.h:23
MitkQtWidgetsExports.h