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..9c6e50e567 100644 --- a/Modules/QtWidgetsExt/src/QmitkHotkeyLineEdit.cpp +++ b/Modules/QtWidgetsExt/src/QmitkHotkeyLineEdit.cpp @@ -1,101 +1,104 @@ /*=================================================================== 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 +// c++ +#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()); -} +} \ No newline at end of file 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 fa6fb7f330..de330146ff 100644 --- a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.cpp +++ b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.cpp @@ -1,92 +1,88 @@ /*=================================================================== 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 #include #include "../QmitkDataManagerView.h" #include "berryIPreferencesService.h" #include "berryPlatform.h" -QmitkNodeTableViewKeyFilter::QmitkNodeTableViewKeyFilter( QObject* _DataManagerView ) -: QObject(_DataManagerView) +QmitkNodeTableViewKeyFilter::QmitkNodeTableViewKeyFilter(QObject* dataManagerView) + : QObject(dataManagerView) { m_PreferencesService = berry::Platform::GetPreferencesService(); } -bool QmitkNodeTableViewKeyFilter::eventFilter( QObject *obj, QEvent *event ) +bool QmitkNodeTableViewKeyFilter::eventFilter(QObject *obj, QEvent *event) { - QmitkDataManagerView* _DataManagerView = qobject_cast(this->parent()); - if (event->type() == QEvent::KeyPress && _DataManagerView) + QmitkDataManagerView* dataManagerView = qobject_cast(this->parent()); + if (event->type() == QEvent::KeyPress && dataManagerView) { berry::IPreferences::Pointer nodeTableKeyPrefs = m_PreferencesService->GetSystemPreferences()->Node("/DataManager/Hotkeys"); - 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 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")); - QKeyEvent *keyEvent = static_cast(event); + 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 == _MakeAllInvisible) + if (keySequence == makeAllInvisible) { // trigger deletion of selected node(s) - _DataManagerView->MakeAllNodesInvisible(true); + dataManagerView->MakeAllNodesInvisible(true); // return true: this means the delete key event is not send to the table return true; } - else if(_KeySequence == _DeleteSelectedNodes) + else if (keySequence == deleteSelectedNodes) { // trigger deletion of selected node(s) - _DataManagerView->RemoveSelectedNodes(true); + dataManagerView->RemoveSelectedNodes(true); // return true: this means the delete key event is not send to the table return true; } - else if(_KeySequence == _ToggleVisibility) + else if (keySequence == toggleVisibility) { // trigger deletion of selected node(s) - _DataManagerView->ToggleVisibilityOfSelectedNodes(true); + dataManagerView->ToggleVisibilityOfSelectedNodes(true); // return true: this means the delete key event is not send to the table return true; } - else if(_KeySequence == _Reinit) + else if (keySequence == reinit) { - _DataManagerView->ReinitSelectedNodes(true); + dataManagerView->ReinitSelectedNodes(true); return true; } - else if(_KeySequence == _GlobalReinit) + else if (keySequence == globalReinit) { - _DataManagerView->GlobalReinit(true); + dataManagerView->GlobalReinit(true); return true; } - else if(_KeySequence == _ShowInfo) + else if (keySequence == showInfo) { - _DataManagerView->ShowInfoDialogForSelectedNodes(true); + dataManagerView->ShowInfoDialogForSelectedNodes(true); 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 2964e08356..aa2cf08050 100644 --- a/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h +++ b/Plugins/org.mitk.gui.qt.datamanager/src/internal/QmitkNodeTableViewKeyFilter.h @@ -1,44 +1,48 @@ /*=================================================================== 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_ +#ifndef QMITKNODETABLEVIEWKEYFILTER_H +#define QMITKNODETABLEVIEWKEYFILTER_H #include namespace berry { -struct IPreferencesService; + 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 "eats" all Del-Key-pressed events on the node table. +* When the Del Key is pressed selected nodes should be removed. +* +* +*/ class QmitkNodeTableViewKeyFilter : public QObject { Q_OBJECT public: - QmitkNodeTableViewKeyFilter(QObject* _DataManagerView = nullptr); + + QmitkNodeTableViewKeyFilter(QObject* dataManagerView = nullptr); + protected: - bool eventFilter(QObject *obj, QEvent *event) override; - /// - /// The Preferences Service to retrieve and store preferences. - /// + virtual bool eventFilter(QObject* obj, QEvent* event) override; + /** + * @brief The Preferences Service to retrieve and store preferences. + */ berry::IPreferencesService* m_PreferencesService; }; -#endif // QMITKNODETABLEVIEWKEYFILTER_H_ +#endif // QMITKNODETABLEVIEWKEYFILTER_H