BALL 1.5.0
editSingleShortcut.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4//
5
6#ifndef BALL_VIEW_DIALOGS_EDITSINGLESHORTCUT_H
7#define BALL_VIEW_DIALOGS_EDITSINGLESHORTCUT_H
8
9#ifndef BALL_VIEW_KERNEL_PREFERENCESENTRY
11#endif
12
13#ifndef BALL_VIEW_KERNEL_SHORTCUTREGISTRY_H
15#endif
16
17#ifndef BALL_VIEW_KERNEL_MODULARWIDGET_H
19#endif
20
21#include <BALL/VIEW/UIC/ui_editSingleShortcut.h>
22
23#include <QtWidgets/QDialog>
24
25class QModelIndex;
26
27namespace BALL
28{
29 namespace VIEW
30 {
31
36 : public QDialog,
37 public Ui_EditSingleShortcutData
38 {
39 // macro needed for Qt's slot mechanism:
40 Q_OBJECT
41
42 public:
43
45 EditSingleShortcut(QWidget* parent = NULL, const char* name = "EditSingleShortcut", Qt::WindowFlags fl = 0 );
46
47 QKeySequence const& getKeySequence() const { return new_sequence_; }
48
49 void setIndex(const QModelIndex& index);
50 void reset();
51 void setup(const QString& shortcut);
52
53 public Q_SLOTS:
54 virtual void accept();
55 virtual void reject();
56
57 protected Q_SLOTS:
58 void modeChanged_(bool toggled);
59
60 protected:
62
63 unsigned int modifiers_;
64 int key_;
65 QKeySequence new_sequence_;
66
68 void setErrorText(QString error);
69
71 void setShortcutText(QString new_keysequence);
72
74 void changeMode_(bool mode);
75
76 void keyPressEvent(QKeyEvent* evt);
77 void keyReleaseEvent(QKeyEvent* evt);
78
81 };
82
83 }
84}
85
86#endif
87
Definition: constants.h:13
EditSingleShortcut(QWidget *parent=NULL, const char *name="EditSingleShortcut", Qt::WindowFlags fl=0)
Constructor.
void keyPressEvent(QKeyEvent *evt)
void keyReleaseEvent(QKeyEvent *evt)
void modeChanged_(bool toggled)
void setIndex(const QModelIndex &index)
void setShortcutText(QString new_keysequence)
QKeySequence const & getKeySequence() const
void setup(const QString &shortcut)
void setErrorText(QString error)
#define BALL_VIEW_EXPORT
Definition: COMMON/global.h:52