QGIS API Documentation 3.37.0-Master (fdefdf9c27f)
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:
40
47 QgsConfigureShortcutsDialog( QWidget *parent SIP_TRANSFERTHIS = nullptr, QgsShortcutsManager *manager = nullptr );
48
49 protected:
50 void keyPressEvent( QKeyEvent *event ) override;
51 void keyReleaseEvent( QKeyEvent *event ) override;
52
53 private slots:
54 void changeShortcut();
55 void resetShortcut();
56 void setNoShortcut();
57 void loadShortcuts();
58 void saveShortcutsPdf();
59 void mLeFilter_textChanged( const QString &text );
60
61 void actionChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
62
64 void showHelp();
65
66 private:
67
69 void populateActions();
70
72 QObject *currentObject();
73
75 QAction *currentAction();
76
78 QShortcut *currentShortcut();
79
81 void saveShortcuts( bool saveAll = true );
82
83 void setGettingShortcut( bool getting );
84 void setCurrentActionShortcut( const QKeySequence &s );
85 void updateShortcutText();
86
87 QgsShortcutsManager *mManager = nullptr;
88 QMenu *mSaveMenu = nullptr;
89 QAction *mSaveUserShortcuts = nullptr;
90 QAction *mSaveAllShortcuts = nullptr;
91 QAction *mSaveAsPdf = nullptr;
92
93 bool mGettingShortcut = false;
94 int mModifiers = 0, mKey = 0;
95
96};
97
98#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