QGIS API Documentation 4.1.0-Master (0cdd3ae6384)
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 public slots:
50
58 void setFilter( const QString &filterText );
59
60 protected:
61 void keyPressEvent( QKeyEvent *event ) override;
62 void keyReleaseEvent( QKeyEvent *event ) override;
63
64 private slots:
65 void changeShortcut();
66 void resetShortcut();
67 void setNoShortcut();
68 void loadShortcuts();
69 void saveShortcutsPdf();
70 void mLeFilter_textChanged( const QString &text );
71
72 void actionChanged( QTreeWidgetItem *current, QTreeWidgetItem *previous );
73
75 void showHelp();
76
77 private:
78 enum class ActionOnExisting
79 {
80 Ask,
81 ReassignAll,
82 SkipAll,
83 };
84
86 void populateActions();
87
89 QObject *currentObject();
90
92 QAction *currentAction();
93
95 QShortcut *currentShortcut();
96
98 void saveShortcuts( bool saveAll = true );
99
100 void setGettingShortcut( bool getting );
101 void setCurrentActionShortcut( const QKeySequence &s );
102 void updateShortcutText();
103
104 QgsShortcutsManager *mManager = nullptr;
105 QMenu *mSaveMenu = nullptr;
106 QAction *mSaveUserShortcuts = nullptr;
107 QAction *mSaveAllShortcuts = nullptr;
108 QAction *mSaveAsPdf = nullptr;
109
110 bool mGettingShortcut = false;
111 Qt::KeyboardModifiers mModifiers = Qt::KeyboardModifiers();
112 int mKey = 0;
113};
114
115#endif //QGSCONFIGURESHORTCUTSDIALOG_H
QgsConfigureShortcutsDialog(QWidget *parent=nullptr, QgsShortcutsManager *manager=nullptr)
Constructor for QgsConfigureShortcutsDialog.
void setFilter(const QString &filterText)
Sets the text for the filter line edit.
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:52