MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkUSAbstractCustomWidget.h
Go to the documentation of this file.
1/*============================================================================
2
3The Medical Imaging Interaction Toolkit (MITK)
4
5Copyright (c) German Cancer Research Center (DKFZ)
6All rights reserved.
7
8Use of this source code is governed by a 3-clause BSD license that can be
9found in the LICENSE file.
10
11============================================================================*/
12
13#ifndef QmitkUSAbstractCustomWidget_h
14#define QmitkUSAbstractCustomWidget_h
15
16#include <QWidget>
17
18#include <MitkUSUIExports.h>
19#include "mitkUSDevice.h"
20
21// Microservices
22#include <mitkServiceInterface.h>
23
65class MITKUSUI_EXPORT QmitkUSAbstractCustomWidget : public QWidget
66{
67 Q_OBJECT
68
69public:
70 QmitkUSAbstractCustomWidget(QWidget* parent = nullptr);
72
73 void SetDevice(mitk::USDevice::Pointer device);
74 mitk::USDevice::Pointer GetDevice() const;
75
81 virtual void OnDeviceSet() = 0;
82
88 virtual std::string GetDeviceClass() const = 0;
89
93 virtual QmitkUSAbstractCustomWidget* Clone(QWidget* parent = nullptr) const = 0;
94
101 virtual void Initialize() = 0;
102
108 QmitkUSAbstractCustomWidget* CloneForQt(QWidget* parent = nullptr) const;
109
115 us::ServiceProperties GetServiceProperties() const;
116
127 void showEvent ( QShowEvent * event ) override;
128
132 static std::string US_DEVICE_PROPKEY_CLASS();
133
134private:
135
136 mitk::USDevice::Pointer m_Device;
137 bool m_IsClonedForQt;
138};
139
140// This is the microservice declaration. Do not meddle!
141MITK_DECLARE_SERVICE_INTERFACE(QmitkUSAbstractCustomWidget, "org.mitk.QmitkUSAbstractCustomWidget")
142
143#endif
Abstract superclass for all custom control widgets of mitk::USDevice classes.
virtual QmitkUSAbstractCustomWidget * Clone(QWidget *parent=nullptr) const =0
Subclass must implement this method to return a pointer to a copy of the object.
virtual void Initialize()=0
Method for initializing the Qt stuff of the widget (setupUI, connect). This method will be called in ...
virtual void OnDeviceSet()=0
Called every time a mitk::USDevice was set with QmitkUSAbstractCustomWidget::SetDevice()....
virtual std::string GetDeviceClass() const =0
Subclass must implement this method to return device class of corresponding mitk::USDevice.