Pencil2D  ff90c0872e88be3bf81c548cd60f01983012ec49
Pencil2D is an animation software for both bitmap and vector graphics. It is free, multi-platform, and open source.
 All Classes Functions
shortcutspage.h
1 /*
2 
3 Pencil - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2013-2017 Matt Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 #ifndef SHORTCUTSPAGE_H
18 #define SHORTCUTSPAGE_H
19 
20 #include <QWidget>
21 #include <QModelIndex>
22 #include <QKeySequence>
23 #include <QSettings>
24 
25 class QTreeView;
26 class QStandardItem;
27 class QStandardItemModel;
28 class QLabel;
29 class QLineEdit;
30 class PreferenceManager;
31 
32 namespace Ui
33 {
34  class ShortcutsPage;
35 }
36 
37 class ShortcutsPage : public QWidget
38 {
39  Q_OBJECT
40 public:
41  explicit ShortcutsPage(QWidget* parent = 0);
42 
43  void setManager( PreferenceManager* p ) { mManager = p; }
44 
45 private slots:
46  void tableItemClicked(const QModelIndex&);
47  void keyCapLineEditTextChanged(QKeySequence);
48  void restoreShortcutsButtonClicked();
49  void clearButtonClicked();
50 
51 private:
52  bool isKeySequenceExist(const QSettings&, QString, QKeySequence);
53  void removeDuplicateKeySequence(QSettings*, QKeySequence);
54  void treeModelLoadShortcutsSetting();
55 
56  QStandardItemModel* m_treeModel = nullptr;
57  QModelIndex m_currentItemIndex;
58 
59  Ui::ShortcutsPage* ui = nullptr;
60 
61  PreferenceManager* mManager = nullptr;
62 };
63 
64 #endif // SHORTCUTSPAGE_H