ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ecvKeySequences.h
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #ifndef ecvKeySequences_h
9 #define ecvKeySequences_h
10 
11 // Local
12 #include "CV_db.h"
13 
14 // Qt
15 #include <QObject>
16 #include <QWidget>
17 
18 class QAction;
19 class ecvModalShortcut;
20 
39 class CV_DB_LIB_API ecvKeySequences : public QObject {
40  Q_OBJECT
41 
42 public:
47 
51  ecvModalShortcut* active(const QKeySequence& keySequence) const;
52 
61  ecvModalShortcut* addModalShortcut(const QKeySequence& keySequence,
62  QAction* action,
63  QWidget* parent);
64 
77  void reorder(ecvModalShortcut* target);
78 
82  void dumpShortcuts(const QKeySequence& keySequence) const;
83 
84 protected Q_SLOTS:
88  virtual void disableSiblings();
89 
94  virtual void enableNextSibling();
95 
99  virtual void removeModalShortcut();
100 
101 protected:
102  ecvKeySequences(QObject* parent);
103  ~ecvKeySequences() override = default;
104 
106  bool m_silence;
107 };
108 
109 #endif // ecvKeySequences_h
#define CV_DB_LIB_API
Definition: CV_db.h:15
Manage key sequences used for shortcuts.
virtual void removeModalShortcut()
~ecvKeySequences() override=default
ecvModalShortcut * addModalShortcut(const QKeySequence &keySequence, QAction *action, QWidget *parent)
void reorder(ecvModalShortcut *target)
bool m_silence
Set true in slot implementations to avoid signal/slot recursion.
virtual void disableSiblings()
virtual void enableNextSibling()
ecvModalShortcut * active(const QKeySequence &keySequence) const
static ecvKeySequences & instance()
void dumpShortcuts(const QKeySequence &keySequence) const
ecvKeySequences(QObject *parent)
Manage an action and/or widget's responsivity to a shortcut.