QGIS API Documentation  3.22.4-Białowieża (ce8e65e95e)
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 loadShortcuts();
59  void saveShortcutsPdf();
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 
82  void saveShortcuts( bool saveAll = true );
83 
84  void setGettingShortcut( bool getting );
85  void setCurrentActionShortcut( const QKeySequence &s );
86  void updateShortcutText();
87 
88  QgsShortcutsManager *mManager = nullptr;
89  QMenu *mSaveMenu = nullptr;
90  QAction *mSaveUserShortcuts = nullptr;
91  QAction *mSaveAllShortcuts = nullptr;
92  QAction *mSaveAsPdf = nullptr;
93 
94  bool mGettingShortcut = false;
95  int mModifiers = 0, mKey = 0;
96 
97 };
98 
99 #endif //QGSCONFIGURESHORTCUTSDIALOG_H
Reusable dialog for allowing users to configure shortcuts contained in a QgsShortcutsManager.
Shortcuts manager is a class that contains a list of QActions and QShortcuts that have been registere...
#define SIP_TRANSFERTHIS
Definition: qgis_sip.h:53