Medical Imaging Interaction Toolkit  2024.12.99-0da743f6
Medical Imaging Interaction Toolkit
QmitkHotkeyLineEdit.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef QmitkHotkeyLineEdit_h
14 #define QmitkHotkeyLineEdit_h
15 
17 
18 // qt
19 #include <QKeySequence>
20 #include <QLineEdit>
21 
23 {
24  Q_OBJECT
25 
26 public:
27 
28  static const std::string TOOLTIP;
29 
30  QmitkHotkeyLineEdit(QWidget* parent = nullptr);
31  QmitkHotkeyLineEdit(const QKeySequence& qKeySequence, QWidget* parent = nullptr);
32  QmitkHotkeyLineEdit(const QString& qQString, QWidget* parent = nullptr);
33 
34  virtual void SetKeySequence(const QKeySequence& qKeySequence);
35  virtual void SetKeySequence(const QString& qKeySequenceAsString);
36  virtual QKeySequence GetKeySequence();
37  virtual QString GetKeySequenceAsString();
38  bool Matches(QKeyEvent *event);
39 
40 protected Q_SLOTS:
41 
42  void LineEditTextChanged(const QString&);
43 
44 protected:
45 
46  void keyPressEvent(QKeyEvent* event) override;
47  void Init();
48 
49  QKeySequence m_KeySequence;
50 
51 };
52 
53 #endif
MITKQTWIDGETSEXT_EXPORT
#define MITKQTWIDGETSEXT_EXPORT
Definition: MitkQtWidgetsExtExports.h:15
QmitkHotkeyLineEdit::TOOLTIP
static const std::string TOOLTIP
Definition: QmitkHotkeyLineEdit.h:28
MitkQtWidgetsExtExports.h
QmitkHotkeyLineEdit::m_KeySequence
QKeySequence m_KeySequence
Definition: QmitkHotkeyLineEdit.h:49
QmitkHotkeyLineEdit
Definition: QmitkHotkeyLineEdit.h:22