QGIS API Documentation 3.99.0-Master (2fe06baccd8)
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 "ui_qgsconfigureshortcutsdialog.h"
20
21#include "qgis_gui.h"
22#include "qgis_sip.h"
23#include "qgshelp.h"
24
25#include <QDialog>
26
27class QShortcut;
29
35
36class GUI_EXPORT QgsConfigureShortcutsDialog : public QDialog, private Ui::QgsConfigureShortcutsDialog
37{
38 Q_OBJECT
39
40 public:
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 enum class ActionOnExisting
68 {
69 Ask,
70 ReassignAll,
71 SkipAll,
72 };
73
75 void populateActions();
76
78 QObject *currentObject();
79
81 QAction *currentAction();
82
84 QShortcut *currentShortcut();
85
87 void saveShortcuts( bool saveAll = true );
88
89 void setGettingShortcut( bool getting );
90 void setCurrentActionShortcut( const QKeySequence &s );
91 void updateShortcutText();
92
93 QgsShortcutsManager *mManager = nullptr;
94 QMenu *mSaveMenu = nullptr;
95 QAction *mSaveUserShortcuts = nullptr;
96 QAction *mSaveAllShortcuts = nullptr;
97 QAction *mSaveAsPdf = nullptr;
98
99 bool mGettingShortcut = false;
100 int mModifiers = 0, mKey = 0;
101};
102
103#endif //QGSCONFIGURESHORTCUTSDIALOG_H
QgsConfigureShortcutsDialog(QWidget *parent=nullptr, QgsShortcutsManager *manager=nullptr)
Constructor for QgsConfigureShortcutsDialog.
void keyReleaseEvent(QKeyEvent *event) override
void keyPressEvent(QKeyEvent *event) override
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