MITK-IGT
IGT Extension of MITK
Loading...
Searching...
No Matches
QmitkUSNavigationCalibrationUpdateDepthDelegate.cpp
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============================================================================*/
13
14#include <QEvent>
15
20
24
25void QmitkUSNavigationCalibrationUpdateDepthDelegate::SetControlInterfaceBMode(mitk::USControlInterfaceBMode::Pointer controlInterfaceBMode)
26{
27 m_ControlInterfaceBMode = controlInterfaceBMode;
28}
29
30bool QmitkUSNavigationCalibrationUpdateDepthDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem& option, const QModelIndex &index)
31{
32 if( event->type() == QEvent::MouseButtonDblClick && m_ControlInterfaceBMode.IsNotNull() )
33 {
34 // change the b mode ultrasound image to the selected depth of the data model
35 m_ControlInterfaceBMode->SetScanningDepth(model->data(index).toDouble());
36 return true;
37 }
38 else
39 {
40 return QStyledItemDelegate::editorEvent(event, model, option, index);
41 }
42}
void SetControlInterfaceBMode(mitk::USControlInterfaceBMode::Pointer controlInterfaceBMode)
bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override
The depth of the b mode ultrasound is changed on double click. A mitk::USControlInterfaceBMode has to...