QGIS API Documentation  3.6.0-Noosa (5873452)
qgsconfigureshortcutsdialog.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsconfigureshortcutsdialog.h
3  -----------------------------
4  begin : May 2009
5  copyright : (C) 2009 by Martin Dobias
6  email : wonder dot sk at gmail dot com
7  ***************************************************************************
8  * *
9  * This program is free software; you can redistribute it and/or modify *
10  * it under the terms of the GNU General Public License as published by *
11  * the Free Software Foundation; either version 2 of the License, or *
12  * (at your option) any later version. *
13  * *
14  ***************************************************************************/
15 
16 #ifndef QGSCONFIGURESHORTCUTSDIALOG_H
17 #define QGSCONFIGURESHORTCUTSDIALOG_H
18 
19 #include <QDialog>
20 #include "qgis_sip.h"
21 
22 #include "ui_qgsconfigureshortcutsdialog.h"
23 #include "qgshelp.h"
24 #include "qgis_gui.h"
25 
26 class QShortcut;
28 
36 class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShortcutsDialog
37 {
38  Q_OBJECT
39 
40  public:
41 
48  QgsConfigureShortcutsDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsShortcutsManager *manager = nullptr );
49 
50  protected:
51  void keyPressEvent( QKeyEvent *event ) override;
52  void keyReleaseEvent( QKeyEvent *event ) override;
53 
54  private slots:
55  void changeShortcut();
56  void resetShortcut();
57  void setNoShortcut();
58  void saveShortcuts();
59  void loadShortcuts();
60  void mLeFilter_textChanged( const QString &text );
61 
62  void actionChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
63 
65  void showHelp();
66 
67  private:
68 
70  void populateActions();
71 
73  QObject *currentObject();
74 
76  QAction *currentAction();
77 
79  QShortcut *currentShortcut();
80 
81  void setGettingShortcut( bool getting );
82  void setCurrentActionShortcut( const QKeySequence &s );
83  void updateShortcutText();
84 
85  QgsShortcutsManager *mManager = nullptr;
86 
87  bool mGettingShortcut = false;
88  int mModifiers = 0, mKey = 0;
89 
90 };
91 
92 #endif //QGSCONFIGURESHORTCUTSDIALOG_H
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:46
Shortcuts manager is a class that contains a list of QActions and QShortcuts that have been registere...
Reusable dialog for allowing users to configure shortcuts contained in a QgsShortcutsManager.