diff --git a/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h b/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h index fc27f4cfdb..f4818e5798 100644 --- a/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h +++ b/Modules/QtWidgetsExt/include/QmitkHotkeyLineEdit.h @@ -1,52 +1,57 @@ /*=================================================================== 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 QMITKHOTKEYLINEEDIT_H_ -#define QMITKHOTKEYLINEEDIT_H_ +#ifndef QMITKHOTKEYLINEEDIT_H +#define QMITKHOTKEYLINEEDIT_H +#include "MitkQtWidgetsExtExports.h" + +// qt #include #include -#include "MitkQtWidgetsExtExports.h" - class MITKQTWIDGETSEXT_EXPORT QmitkHotkeyLineEdit : public QLineEdit { Q_OBJECT public: + static const std::string TOOLTIP; - QmitkHotkeyLineEdit(QWidget *parent = nullptr); - QmitkHotkeyLineEdit(const QKeySequence &_QKeySequence, QWidget *parent = nullptr); - QmitkHotkeyLineEdit(const QString &_QString, QWidget *parent = nullptr); + QmitkHotkeyLineEdit(QWidget* parent = nullptr); + QmitkHotkeyLineEdit(const QKeySequence& qKeySequence, QWidget* parent = nullptr); + QmitkHotkeyLineEdit(const QString& qQString, QWidget* parent = nullptr); - virtual void SetKeySequence(const QKeySequence &_QKeySequence); - virtual void SetKeySequence(const QString &_QKeySequenceAsString); + virtual void SetKeySequence(const QKeySequence& qKeySequence); + virtual void SetKeySequence(const QString& qKeySequenceAsString); virtual QKeySequence GetKeySequence(); virtual QString GetKeySequenceAsString(); bool Matches(QKeyEvent *event); -protected slots: - void LineEditTextChanged(const QString &); + +protected Q_SLOTS: + + void LineEditTextChanged(const QString&); protected: - void keyPressEvent(QKeyEvent *event) override; + + virtual void keyPressEvent(QKeyEvent* event) override; void Init(); -protected: QKeySequence m_KeySequence; + }; -#endif +#endif // QMITKHOTKEYLINEEDIT_H diff --git a/Modules/QtWidgetsExt/src/QmitkHotkeyLineEdit.cpp b/Modules/QtWidgetsExt/src/QmitkHotkeyLineEdit.cpp index 541d905d2c..a884b3b50a 100644 --- a/Modules/QtWidgetsExt/src/QmitkHotkeyLineEdit.cpp +++ b/Modules/QtWidgetsExt/src/QmitkHotkeyLineEdit.cpp @@ -1,101 +1,101 @@ /*=================================================================== 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 "QmitkHotkeyLineEdit.h" #include #include #include #include const std::string QmitkHotkeyLineEdit::TOOLTIP = "Press any key (combination)"; -QmitkHotkeyLineEdit::QmitkHotkeyLineEdit(QWidget *parent) : QLineEdit(parent) +QmitkHotkeyLineEdit::QmitkHotkeyLineEdit(QWidget* parent /*= nullptr*/) + : QLineEdit(parent) { - this->Init(); + Init(); } -QmitkHotkeyLineEdit::QmitkHotkeyLineEdit(const QKeySequence &_QKeySequence, QWidget *parent) : QLineEdit(parent) +QmitkHotkeyLineEdit::QmitkHotkeyLineEdit(const QKeySequence& qKeySequence, QWidget* parent /*= nullptr*/) + : QLineEdit(parent) { - this->Init(); - this->SetKeySequence(_QKeySequence); + Init(); + SetKeySequence(qKeySequence); } -QmitkHotkeyLineEdit::QmitkHotkeyLineEdit(const QString &_QKeySequenceAsString, QWidget *parent) : QLineEdit(parent) +QmitkHotkeyLineEdit::QmitkHotkeyLineEdit(const QString& qKeySequenceAsString, QWidget* parent /*= nullptr*/) + : QLineEdit(parent) { - this->Init(); - this->SetKeySequence(_QKeySequenceAsString); + Init(); + SetKeySequence(qKeySequenceAsString); } void QmitkHotkeyLineEdit::Init() { - this->setToolTip(QString::fromStdString(QmitkHotkeyLineEdit::TOOLTIP)); - this->setReadOnly(true); - connect(this, SIGNAL(textChanged(const QString &)), this, SLOT(LineEditTextChanged(const QString &))); + setToolTip(QString::fromStdString(QmitkHotkeyLineEdit::TOOLTIP)); + setReadOnly(true); + connect(this, &QLineEdit::textChanged, this, &QmitkHotkeyLineEdit::LineEditTextChanged); } -void QmitkHotkeyLineEdit::keyPressEvent(QKeyEvent *event) +void QmitkHotkeyLineEdit::keyPressEvent(QKeyEvent* event) { if (event->key() == Qt::Key_unknown) + { return; + } else if (event->key() == Qt::Key_Escape) + { m_KeySequence = QKeySequence(); - + } else { - m_KeySequence = QKeySequence(event->modifiers(), event->key()); - // if no modifier was pressed the sequence is now empty - if (event->modifiers() == Qt::NoModifier) - m_KeySequence = QKeySequence(event->key()); + m_KeySequence = QKeySequence(event->modifiers() + event->key()); } - this->SetKeySequence(m_KeySequence); + SetKeySequence(m_KeySequence); } -void QmitkHotkeyLineEdit::SetKeySequence(const QKeySequence &_QKeySequence) +void QmitkHotkeyLineEdit::SetKeySequence(const QKeySequence& qKeySequence) { - this->setText(_QKeySequence.toString()); + setText(qKeySequence.toString()); } -void QmitkHotkeyLineEdit::SetKeySequence(const QString &_QKeySequenceAsString) +void QmitkHotkeyLineEdit::SetKeySequence(const QString& qKeySequenceAsString) { - this->SetKeySequence(QKeySequence(_QKeySequenceAsString)); + SetKeySequence(QKeySequence(qKeySequenceAsString)); } QKeySequence QmitkHotkeyLineEdit::GetKeySequence() { return m_KeySequence; } QString QmitkHotkeyLineEdit::GetKeySequenceAsString() { return m_KeySequence.toString(); } -bool QmitkHotkeyLineEdit::Matches(QKeyEvent *event) +bool QmitkHotkeyLineEdit::Matches(QKeyEvent* event) { - QKeySequence _KeySequence = QKeySequence(event->modifiers(), event->key()); - // if no modifier was pressed the sequence is now empty - if (event->modifiers() == Qt::NoModifier) - _KeySequence = QKeySequence(event->key()); + QKeySequence keySequence = QKeySequence(event->modifiers() + event->key()); - return _KeySequence == m_KeySequence; + return keySequence == m_KeySequence; } -void QmitkHotkeyLineEdit::LineEditTextChanged(const QString &text) +void QmitkHotkeyLineEdit::LineEditTextChanged(const QString& text) { m_KeySequence = QKeySequence(text.toUpper()); } diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.cpp b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.cpp index defbae33ea..336a07e799 100644 --- a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.cpp +++ b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.cpp @@ -1,154 +1,143 @@ /*=================================================================== 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 "QmitkDataManagerHotkeysPrefPage.h" + +// mitk qt widgets ext module #include -#include "berryIPreferencesService.h" -#include "berryPlatform.h" +// berry +#include +#include +// qt #include #include #include #include #include #include -#include - -using namespace berry; - QmitkDataManagerHotkeysPrefPage::QmitkDataManagerHotkeysPrefPage() -: m_MainControl(nullptr) + : m_MainControl(nullptr) { - } -void QmitkDataManagerHotkeysPrefPage::Init(berry::IWorkbench::Pointer ) +void QmitkDataManagerHotkeysPrefPage::Init(berry::IWorkbench::Pointer) { - } void QmitkDataManagerHotkeysPrefPage::CreateQtControl(QWidget* parent) { - IPreferencesService* prefService = Platform::GetPreferencesService(); - berry::IPreferences::Pointer _DataManagerHotkeysPreferencesNode = prefService->GetSystemPreferences()->Node("/DataManager/Hotkeys"); - m_DataManagerHotkeysPreferencesNode = _DataManagerHotkeysPreferencesNode; - - m_HotkeyEditors["Make all nodes invisible"] = new QmitkHotkeyLineEdit("Ctrl+, V"); + berry::IPreferencesService* prefService = berry::Platform::GetPreferencesService(); + berry::IPreferences::Pointer dataManagerHotkeysPreferencesNode = prefService->GetSystemPreferences()->Node("/DataManager/Hotkeys"); + m_DataManagerHotkeysPreferencesNode = dataManagerHotkeysPreferencesNode; + m_HotkeyEditors["Make all nodes invisible"] = new QmitkHotkeyLineEdit("Ctrl+V"); m_HotkeyEditors["Toggle visibility of selected nodes"] = new QmitkHotkeyLineEdit("V"); - m_HotkeyEditors["Delete selected nodes"] = new QmitkHotkeyLineEdit("Del"); - m_HotkeyEditors["Reinit selected nodes"] = new QmitkHotkeyLineEdit("R"); - - m_HotkeyEditors["Global Reinit"] = new QmitkHotkeyLineEdit("Ctrl+, R"); - - m_HotkeyEditors["Show Node Information"] = new QmitkHotkeyLineEdit("Ctrl+, I"); + m_HotkeyEditors["Global reinit"] = new QmitkHotkeyLineEdit("Ctrl+R"); + m_HotkeyEditors["Show node information"] = new QmitkHotkeyLineEdit("Ctrl+I"); m_MainControl = new QWidget(parent); - auto layout = new QGridLayout; + auto layout = new QGridLayout; int i = 0; - for (auto it = m_HotkeyEditors.begin() - ; it != m_HotkeyEditors.end(); ++it) + for (auto it = m_HotkeyEditors.begin(); it != m_HotkeyEditors.end(); ++it) { - layout->addWidget(new QLabel(it->first), i,0); - layout->addWidget(it->second, i,1); - layout->setRowStretch(i,0); + layout->addWidget(new QLabel(it->first), i, 0); + layout->addWidget(it->second, i, 1); + layout->setRowStretch(i, 0); ++i; } - layout->setRowStretch(i+1,10); + layout->setRowStretch(i + 1, 10); m_MainControl->setLayout(layout); - this->Update(); + Update(); } QWidget* QmitkDataManagerHotkeysPrefPage::GetQtControl() const { return m_MainControl; } bool QmitkDataManagerHotkeysPrefPage::PerformOk() { - IPreferences::Pointer _DataManagerHotkeysPreferencesNode = m_DataManagerHotkeysPreferencesNode.Lock(); - if(_DataManagerHotkeysPreferencesNode.IsNotNull()) + berry::IPreferences::Pointer dataManagerHotkeysPreferencesNode = m_DataManagerHotkeysPreferencesNode.Lock(); + if (dataManagerHotkeysPreferencesNode.IsNotNull()) { - bool duplicate = false; QString keyString; QString errString; - for (auto it = m_HotkeyEditors.begin() - ; it != m_HotkeyEditors.end(); ++it) + for (auto it = m_HotkeyEditors.begin(); it != m_HotkeyEditors.end(); ++it) { keyString = it->second->GetKeySequenceAsString(); - if(keyString.isEmpty()) + if (keyString.isEmpty()) + { errString = QString("No valid key sequence for \"%1\"").arg(it->first); + } - if(errString.isEmpty()) + if (errString.isEmpty()) { std::map::iterator it2; // search for duplicated key for (it2 = m_HotkeyEditors.begin(); it2 != m_HotkeyEditors.end(); ++it2) { - if(it->first != it2->first && keyString == it2->second->GetKeySequenceAsString()) - { - duplicate = true; - break; - } + if (it->first != it2->first && keyString == it2->second->GetKeySequenceAsString()) + { + errString = QString("Duplicate hot key for \"%1\" and \"%2\"").arg(it->first).arg(it2->first); + break; + } } - if(duplicate == true) - errString = QString("Duplicate hot key for \"%1\" and \"%2\"").arg(it->first).arg(it2->first); } - if(!errString.isEmpty()) + if (!errString.isEmpty()) { QMessageBox::critical(QApplication::activeWindow(), "Error", errString); return false; } } - //# no errors -> save all values and flush to file - for (auto it = m_HotkeyEditors.begin() - ; it != m_HotkeyEditors.end(); ++it) - _DataManagerHotkeysPreferencesNode->Put(it->first - , it->second->GetKeySequenceAsString()); - - _DataManagerHotkeysPreferencesNode->Flush(); + // no errors -> save all values and flush to file + for (auto it = m_HotkeyEditors.begin(); it != m_HotkeyEditors.end(); ++it) + { + QString keySequence = it->second->GetKeySequenceAsString(); + dataManagerHotkeysPreferencesNode->Put(it->first, it->second->GetKeySequenceAsString()); + } + dataManagerHotkeysPreferencesNode->Flush(); return true; } + return false; } void QmitkDataManagerHotkeysPrefPage::PerformCancel() { - } void QmitkDataManagerHotkeysPrefPage::Update() { - IPreferences::Pointer _DataManagerHotkeysPreferencesNode = m_DataManagerHotkeysPreferencesNode.Lock(); - if(_DataManagerHotkeysPreferencesNode.IsNotNull()) + berry::IPreferences::Pointer dataManagerHotkeysPreferencesNode = m_DataManagerHotkeysPreferencesNode.Lock(); + if (dataManagerHotkeysPreferencesNode.IsNotNull()) { - for (auto it = m_HotkeyEditors.begin() - ; it != m_HotkeyEditors.end(); ++it) + for (auto it = m_HotkeyEditors.begin(); it != m_HotkeyEditors.end(); ++it) { - it->second->setText(_DataManagerHotkeysPreferencesNode->Get(it->first, it->second->text())); + it->second->setText(dataManagerHotkeysPreferencesNode->Get(it->first, it->second->text())); } } } diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h index 59cf49fe46..82916d7f0c 100644 --- a/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h +++ b/Plugins/org.mitk.gui.qt.datamanager/src/QmitkDataManagerHotkeysPrefPage.h @@ -1,72 +1,77 @@ /*=================================================================== 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 QMITKDATAMANAGERHOTKEYSPREFPAGE_H +#define QMITKDATAMANAGERHOTKEYSPREFPAGE_H -#ifndef QMITKDATAMANAGERHOTKEYSPREFPAGE_H_ -#define QMITKDATAMANAGERHOTKEYSPREFPAGE_H_ - -#include "berryIQtPreferencePage.h" #include -#include +// blueberry ui qt plugin +#include + +// qt #include +// c++ +#include + class QmitkHotkeyLineEdit; struct MITK_QT_DATAMANAGER QmitkDataManagerHotkeysPrefPage : public QObject, public berry::IQtPreferencePage { Q_OBJECT Q_INTERFACES(berry::IPreferencePage) public: QmitkDataManagerHotkeysPrefPage(); - void Init(berry::IWorkbench::Pointer workbench) override; - - void CreateQtControl(QWidget* parent) override; + virtual void Init(berry::IWorkbench::Pointer workbench) override; - QWidget* GetQtControl() const override; + virtual void CreateQtControl(QWidget* parent) override; - /// - /// \see IPreferencePage::PerformOk() - /// - bool PerformOk() override; + virtual QWidget* GetQtControl() const override; - /// - /// \see IPreferencePage::PerformCancel() - /// - void PerformCancel() override; - - /// - /// \see IPreferencePage::Update() - /// - void Update() override; + /** + * @brief \see IPreferencePage::PerformOk() + */ + virtual bool PerformOk() override; + /** + * @brief \see IPreferencePage::PerformCancel() + */ + virtual void PerformCancel() override; + /** + * @brief \see IPreferencePage::Update() + */ + virtual void Update() override; protected: - /// - /// The node from which the properties are taken (will be catched from the preferences service in ctor) - /// + /** + * @brief The node from which the properties are taken (will be catched from the preferences service in ctor) + * + * + */ berry::IPreferences::WeakPtr m_DataManagerHotkeysPreferencesNode; - - /// - /// Maps a label to hotkey lineedit, e.g. "Toggle Visibility of selected nodes" => QmitkHotkeyLineEdit - /// + /** + * @brief Maps a label to hotkey lineedit, e.g. "Toggle Visibility of selected nodes" => QmitkHotkeyLineEdit + * + * + */ std::map m_HotkeyEditors; QWidget* m_MainControl; }; -#endif /* QMITKDATAMANAGERHOTKEYSPREFPAGE_H_ */ +#endif // QMITKDATAMANAGERHOTKEYSPREFPAGE_H diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.cpp b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.cpp index 594bfad4e1..20332d8bd1 100644 --- a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.cpp +++ b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.cpp @@ -1,107 +1,105 @@ /*=================================================================== 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 "QmitkNodeTableViewKeyFilter.h" #include "../QmitkDataManagerView.h" // mitk gui qt application plugin #include #include #include #include #include #include #include "berryIPreferencesService.h" #include "berryPlatform.h" // qt #include #include -QmitkNodeTableViewKeyFilter::QmitkNodeTableViewKeyFilter(QObject* dataManagerView, mitk::DataStorage* dataStorage) - : QObject(dataManagerView) - , m_DataStorage(dataStorage) +QmitkNodeTableViewKeyFilter::QmitkNodeTableViewKeyFilter(QObject *dataManagerView, mitk::DataStorage *dataStorage) + : QObject(dataManagerView), m_DataStorage(dataStorage) { m_PreferencesService = berry::Platform::GetPreferencesService(); } bool QmitkNodeTableViewKeyFilter::eventFilter(QObject *obj, QEvent *event) { - if (m_DataStorage.IsExpired()) - { - // standard event processing - return QObject::eventFilter(obj, event); - } + if (m_DataStorage.IsExpired()) + { + // standard event processing + return QObject::eventFilter(obj, event); + } - auto dataStorage = m_DataStorage.Lock(); + auto dataStorage = m_DataStorage.Lock(); - QmitkDataManagerView* dataManagerView = qobject_cast(this->parent()); + QmitkDataManagerView *dataManagerView = qobject_cast(this->parent()); if (event->type() == QEvent::KeyPress && dataManagerView) { - berry::IPreferences::Pointer nodeTableKeyPrefs = m_PreferencesService->GetSystemPreferences()->Node("/DataManager/Hotkeys"); + berry::IPreferences::Pointer nodeTableKeyPrefs = + m_PreferencesService->GetSystemPreferences()->Node("/DataManager/Hotkeys"); - QKeySequence makeAllInvisible = QKeySequence(nodeTableKeyPrefs->Get("Make all nodes invisible", "Ctrl+, V")); + QKeySequence makeAllInvisible = QKeySequence(nodeTableKeyPrefs->Get("Make all nodes invisible", "Ctrl+V")); QKeySequence toggleVisibility = QKeySequence(nodeTableKeyPrefs->Get("Toggle visibility of selected nodes", "V")); QKeySequence deleteSelectedNodes = QKeySequence(nodeTableKeyPrefs->Get("Delete selected nodes", "Del")); QKeySequence reinit = QKeySequence(nodeTableKeyPrefs->Get("Reinit selected nodes", "R")); - QKeySequence globalReinit = QKeySequence(nodeTableKeyPrefs->Get("Global Reinit", "Ctrl+, R")); - QKeySequence showInfo = QKeySequence(nodeTableKeyPrefs->Get("Show Node Information", "Ctrl+, I")); + QKeySequence globalReinit = QKeySequence(nodeTableKeyPrefs->Get("Global reinit", "Ctrl+R")); + QKeySequence showInfo = QKeySequence(nodeTableKeyPrefs->Get("Show node information", "Ctrl+I")); QKeyEvent *keyEvent = static_cast(event); - - QKeySequence keySequence = QKeySequence(keyEvent->modifiers(), keyEvent->key()); + QKeySequence keySequence = QKeySequence(keyEvent->modifiers() + keyEvent->key()); // if no modifier was pressed the sequence is now empty - if (keySequence.isEmpty()) - { - keySequence = QKeySequence(keyEvent->key()); - } + if (keySequence.isEmpty()) + { + keySequence = QKeySequence(keyEvent->key()); + } if (keySequence == makeAllInvisible) { - HideAllAction::Run(dataStorage); - + HideAllAction::Run(dataStorage); return true; } - else if(keySequence == deleteSelectedNodes) + else if (keySequence == deleteSelectedNodes) { - RemoveAction::Run(dataManagerView->GetSite(), dataStorage); + RemoveAction::Run(dataManagerView->GetSite(), dataStorage); return true; } - else if(keySequence == toggleVisibility) + else if (keySequence == toggleVisibility) { - ToggleVisibilityAction::Run(dataManagerView->GetSite(), dataStorage); + ToggleVisibilityAction::Run(dataManagerView->GetSite(), dataStorage); return true; } - else if(keySequence == reinit) + else if (keySequence == reinit) { - ReinitAction::Run(dataManagerView->GetSite(), dataStorage); + ReinitAction::Run(dataManagerView->GetSite(), dataStorage); return true; } - else if(keySequence == globalReinit) + else if (keySequence == globalReinit) { - GlobalReinitAction::Run(dataManagerView->GetSite(), dataStorage); + GlobalReinitAction::Run(dataManagerView->GetSite(), dataStorage); return true; } - else if(keySequence == showInfo) + else if (keySequence == showInfo) { - ShowDetailsAction::Run(dataManagerView->GetSite()); + ShowDetailsAction::Run(dataManagerView->GetSite()); return true; } } // standard event processing return QObject::eventFilter(obj, event); } diff --git a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h index 3b5715a599..74702c874e 100644 --- a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h +++ b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h @@ -1,55 +1,53 @@ /*=================================================================== 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 QMITKNODETABLEVIEWKEYFILTER_H #define QMITKNODETABLEVIEWKEYFILTER_H // mitk core #include #include #include namespace berry { struct IPreferencesService; } -/// -/// A small class which "eats" all Del-Key-pressed events on the node table. -/// When the Del Key is pressed selected nodes should be removed. -/// +/** +* @brief A small class which receives key-pressed events on the node table. +*/ class QmitkNodeTableViewKeyFilter : public QObject { Q_OBJECT public: - QmitkNodeTableViewKeyFilter(QObject* dataManagerView, mitk::DataStorage* dataStorage); + QmitkNodeTableViewKeyFilter(QObject *dataManagerView, mitk::DataStorage *dataStorage); protected: - bool eventFilter(QObject *obj, QEvent *event) override; + virtual bool eventFilter(QObject *obj, QEvent *event) override; + /** + * @brief The Preferences Service to retrieve and store preferences. + */ + berry::IPreferencesService *m_PreferencesService; - /// - /// The Preferences Service to retrieve and store preferences. - /// - berry::IPreferencesService* m_PreferencesService; - - mitk::WeakPointer m_DataStorage; + mitk::WeakPointer m_DataStorage; }; #endif // QMITKNODETABLEVIEWKEYFILTER_H