Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef QMITKHOTKEYLINEEDIT_H_
18 #define QMITKHOTKEYLINEEDIT_H_
19 
20 #include <QKeySequence>
21 #include <QLineEdit>
22 
24 
26 {
27  Q_OBJECT
28 
29 public:
30  static const std::string TOOLTIP;
31 
32  QmitkHotkeyLineEdit(QWidget *parent = nullptr);
33  QmitkHotkeyLineEdit(const QKeySequence &_QKeySequence, QWidget *parent = nullptr);
34  QmitkHotkeyLineEdit(const QString &_QString, QWidget *parent = nullptr);
35 
36  virtual void SetKeySequence(const QKeySequence &_QKeySequence);
37  virtual void SetKeySequence(const QString &_QKeySequenceAsString);
38  virtual QKeySequence GetKeySequence();
39  virtual QString GetKeySequenceAsString();
40  bool Matches(QKeyEvent *event);
41 protected slots:
42  void LineEditTextChanged(const QString &);
43 
44 protected:
45  virtual void keyPressEvent(QKeyEvent *event) override;
46  void Init();
47 
48 protected:
49  QKeySequence m_KeySequence;
50 };
51 
52 #endif
#define MITKQTWIDGETSEXT_EXPORT
static const std::string TOOLTIP