QGIS API Documentation 3.43.0-Master (a93bf8b6462)
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
26class QShortcut;
28
35class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShortcutsDialog
36{
37 Q_OBJECT
38
39 public:
46 QgsConfigureShortcutsDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsShortcutsManager *manager = nullptr );
47
48 protected:
49 void keyPressEvent( QKeyEvent *event ) override;
50 void keyReleaseEvent( QKeyEvent *event ) override;
51
52 private slots:
53 void changeShortcut();
54 void resetShortcut();
55 void setNoShortcut();
56 void loadShortcuts();
57 void saveShortcutsPdf();
58 void mLeFilter_textChanged( const QString &text );
59
60 void actionChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
61
63 void showHelp();
64
65 private:
66 enum class ActionOnExisting
67 {
68 Ask,
69 ReassignAll,
70 SkipAll,
71 };
72
74 void populateActions();
75
77 QObject *currentObject();
78
80 QAction *currentAction();
81
83 QShortcut *currentShortcut();
84
86 void saveShortcuts( bool saveAll = true );
87
88 void setGettingShortcut( bool getting );
89 void setCurrentActionShortcut( const QKeySequence &s );
90 void updateShortcutText();
91
92 QgsShortcutsManager *mManager = nullptr;
93 QMenu *mSaveMenu = nullptr;
94 QAction *mSaveUserShortcuts = nullptr;
95 QAction *mSaveAllShortcuts = nullptr;
96 QAction *mSaveAsPdf = nullptr;
97
98 bool mGettingShortcut = false;
99 int mModifiers = 0, mKey = 0;
100};
101
102#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