diff --git a/Modules/QtWidgets/include/QmitkDnDDataNodeWidget.h b/Modules/QtWidgets/include/QmitkDnDDataNodeWidget.h index 7a927a3314..baad4fe34b 100644 --- a/Modules/QtWidgets/include/QmitkDnDDataNodeWidget.h +++ b/Modules/QtWidgets/include/QmitkDnDDataNodeWidget.h @@ -1,66 +1,64 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKDNDDATANODEWIDGET_H #define QMITKDNDDATANODEWIDGET_H #include "MitkQtWidgetsExports.h" // mitk core module #include // qt #include class QDragEnterEvent; class QDropEvent; /** * @brief A drag 'n' drop widget (QFrame) that checks the mime data of the incoming * event. If the drag event is coming from another widget and the mime data * is of type 'application/x-qmitk-datanode-ptrs' the node(s) will be dropped * and a signal is emitted. -* A class including this dnd-widget can than handle the vector of dropped nodes +* A class including this DnD-widget can than handle the vector of dropped nodes * appropriately. -* */ class MITKQTWIDGETS_EXPORT QmitkDnDDataNodeWidget : public QFrame { Q_OBJECT public: QmitkDnDDataNodeWidget(QWidget* parent = nullptr); ~QmitkDnDDataNodeWidget() override; Q_SIGNALS: /** * @brief The signal will be emitted if the drag events are accepted. - * It contains the sending dnd-widget and the vector of nodes that have been dropped. - * + * It contains the vector of nodes that have been dropped. */ - void NodesDropped(QmitkDnDDataNodeWidget* dnDDataNodeWidget, std::vector nodes); + void NodesDropped(std::vector nodes); private: void dragEnterEvent(QDragEnterEvent* event) override; void dragMoveEvent(QDragMoveEvent* event) override; void dropEvent(QDropEvent* event) override; }; #endif // QMITKDNDDATANODEWIDGET_H diff --git a/Modules/QtWidgets/src/QmitkDnDDataNodeWidget.cpp b/Modules/QtWidgets/src/QmitkDnDDataNodeWidget.cpp index 010e2504a0..fbdab13999 100644 --- a/Modules/QtWidgets/src/QmitkDnDDataNodeWidget.cpp +++ b/Modules/QtWidgets/src/QmitkDnDDataNodeWidget.cpp @@ -1,70 +1,70 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #include // mitk qt widgets module #include "QmitkMimeTypes.h" // qt #include QmitkDnDDataNodeWidget::QmitkDnDDataNodeWidget(QWidget* parent /*= nullptr*/) : QFrame(parent) { - setAcceptDrops(true); + this->setAcceptDrops(true); } QmitkDnDDataNodeWidget::~QmitkDnDDataNodeWidget() { // nothing here } void QmitkDnDDataNodeWidget::dragEnterEvent(QDragEnterEvent* event) { if (this != event->source()) { event->acceptProposedAction(); } else { event->ignore(); } } void QmitkDnDDataNodeWidget::dragMoveEvent(QDragMoveEvent* event) { if (event->mimeData()->hasFormat(QmitkMimeTypes::DataNodePtrs)) { event->acceptProposedAction(); } else { event->ignore(); } } void QmitkDnDDataNodeWidget::dropEvent(QDropEvent* event) { QList dataNodeList = QmitkMimeTypes::ToDataNodePtrList(event->mimeData()); if (!dataNodeList.empty()) { - emit NodesDropped(this, dataNodeList.toVector().toStdVector()); + emit NodesDropped(dataNodeList.toVector().toStdVector()); } event->acceptProposedAction(); } diff --git a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h index 805dc045bf..8ccf94a8f9 100644 --- a/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h +++ b/Plugins/org.mitk.gui.qt.semanticrelations/src/internal/QmitkSemanticRelationsView.h @@ -1,108 +1,108 @@ /*=================================================================== The Medical Imaging Interaction Toolkit (MITK) Copyright (c) German Cancer Research Center, Division of Medical and Biological Informatics. All rights reserved. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See LICENSE.txt or http://www.mitk.org for details. ===================================================================*/ #ifndef QMITKSEMANTICRELATIONSVIEW_H #define QMITKSEMANTICRELATIONSVIEW_H // semantic relations plugin #include "ui_QmitkSemanticRelationsControls.h" #include "QmitkLesionInfoWidget.h" #include "QmitkSemanticRelationsContextMenu.h" // semantic relations module #include #include // semantic relations UI module #include // mitk gui common plugin #include // berry #include // mitk qt #include class QmitkDnDDataNodeWidget; class QMenu; /* * @brief The QmitkSemanticRelationsView is an MITK view to combine and show the widgets of the 'SemanticRelationsUI'-module and this semantic relations plugin. * * It allows the MITK user to see and modify the content of the SemanticRelations-session. * A combo box is used to select and show the current patient. */ class QmitkSemanticRelationsView : public QmitkAbstractView, public mitk::IRenderWindowPartListener { Q_OBJECT public: static const std::string VIEW_ID; protected: virtual void SetFocus() override; virtual void CreateQtPartControl(QWidget* parent) override; virtual void RenderWindowPartActivated(mitk::IRenderWindowPart* renderWindowPart) override; virtual void RenderWindowPartDeactivated(mitk::IRenderWindowPart* renderWindowPart) override; private Q_SLOTS: void OnLesionSelectionChanged(const mitk::SemanticTypes::Lesion&); void OnDataNodeSelectionChanged(const QList&); void OnDataNodeDoubleClicked(const mitk::DataNode*); void OnCaseIDSelectionChanged(const QString&); - void OnNodesAdded(QmitkDnDDataNodeWidget*, std::vector); + void OnNodesAdded(std::vector); void OnNodeRemoved(const mitk::DataNode*); private: void SetUpConnections(); /** * @brief Provide a QItemSelectionModel, which supports the data role 'QmitkDataNodeRole' (\see QmitkRenderWindowDataModel). * * The provided QItemSelectionModel is used in the QmitkAbstractView-base class as the selection model of * the selection provider (\see QmitkAbstractView::SetSelectionProvider()). * The default selection provider is a QmitkDataNodeSelectionProvider. Each time a selection in the provided * QItemSeletionModel is changed, a selection changed event is fired. All plugins (views), that subclass the * QmitkAbstractView will be informed about the selection changed via the OnSelectionChanged-function. */ virtual QItemSelectionModel* GetDataNodeSelectionModel() const override; virtual void NodeRemoved(const mitk::DataNode* dataNode) override; void AddToComboBox(const mitk::SemanticTypes::CaseID& caseID); void RemoveFromComboBox(const mitk::SemanticTypes::CaseID& caseID); void OpenInEditor(const mitk::DataNode* dataNode); void JumpToPosition(const mitk::DataNode* dataNode); Ui::QmitkSemanticRelationsControls m_Controls; QmitkLesionInfoWidget* m_LesionInfoWidget; QmitkPatientTableInspector* m_PatientTableInspector; QmitkDnDDataNodeWidget* m_DnDDataNodeWidget; QmitkSemanticRelationsContextMenu* m_ContextMenu; std::unique_ptr m_SemanticRelations; }; #endif // QMITKSEMANTICRELATIONSVIEW_H