QGIS API Documentation 3.41.0-Master (cea29feecf2)
Loading...
Searching...
No Matches
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:
67 void populateActions();
68
70 QObject *currentObject();
71
73 QAction *currentAction();
74
76 QShortcut *currentShortcut();
77
79 void saveShortcuts( bool saveAll = true );
80
81 void setGettingShortcut( bool getting );
82 void setCurrentActionShortcut( const QKeySequence &s );
83 void updateShortcutText();
84
85 QgsShortcutsManager *mManager = nullptr;
86 QMenu *mSaveMenu = nullptr;
87 QAction *mSaveUserShortcuts = nullptr;
88 QAction *mSaveAllShortcuts = nullptr;
89 QAction *mSaveAsPdf = nullptr;
90
91 bool mGettingShortcut = false;
92 int mModifiers = 0, mKey = 0;
93};
94
95#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