QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
shortcutsconfigpage.h
Go to the documentation of this file.
1/*
2 Copyright 2006-2026 The QElectroTech Team
3 This file is part of QElectroTech.
4
5 QElectroTech is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 2 of the License, or
8 (at your option) any later version.
9
10 QElectroTech is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
17*/
18#ifndef SHORTCUTSCONFIGPAGE_H
19#define SHORTCUTSCONFIGPAGE_H
20
21#include "configpage.h"
22
23#include <QKeySequence>
24
25class QComboBox;
26class QKeySequenceEdit;
27class QLabel;
28class QLineEdit;
29class QTreeWidget;
30class QTreeWidgetItem;
31
40{
41 Q_OBJECT
42
43 public:
44 explicit ShortcutsConfigPage(QWidget *parent = nullptr);
45 ~ShortcutsConfigPage() override;
46
47 void applyConf() override;
48 QString title() const override;
49 QIcon icon() const override;
50
51 private slots:
52 void filterRows(const QString &filter_text);
53 void quickFilterChanged(int index);
54 void checkConflicts();
55 void resetAllRows();
56
57 private:
64
65 struct Row {
66 QString id;
67 QString category;
68 QString description;
69 QKeySequence default_sequence;
70 QKeySequenceEdit *edit;
71 QTreeWidgetItem *item;
73 };
74
75 void populateTable();
76 void applyFilter();
77 void resetRow(int row_index);
78
79 QLineEdit *m_filter_edit;
80 QComboBox *m_quick_filter;
82 QTreeWidget *m_tree;
83 QList<Row> m_rows;
84};
85
86#endif // SHORTCUTSCONFIGPAGE_H
ConfigPage(QWidget *parent)
Definition configpage.h:34
QString title() const override
Definition shortcutsconfigpage.cpp:354
QIcon icon() const override
Definition shortcutsconfigpage.cpp:359
QTreeWidget * m_tree
Definition shortcutsconfigpage.h:82
void resetAllRows()
Definition shortcutsconfigpage.cpp:334
~ShortcutsConfigPage() override
Definition shortcutsconfigpage.cpp:120
void quickFilterChanged(int index)
ShortcutsConfigPage::quickFilterChanged Re-run the combined text + quick filter whenever the quick fi...
Definition shortcutsconfigpage.cpp:191
QComboBox * m_quick_filter
Definition shortcutsconfigpage.h:80
QLineEdit * m_filter_edit
Definition shortcutsconfigpage.h:79
void resetRow(int row_index)
ShortcutsConfigPage::resetRow Reset the shortcut editor at row_index to its default sequence.
Definition shortcutsconfigpage.cpp:325
void applyConf() override
ShortcutsConfigPage::applyConf Persist every row's shortcut edit through ShortcutManager,...
Definition shortcutsconfigpage.cpp:347
void populateTable()
ShortcutsConfigPage::populateTable Fill the tree with one collapsible top-level node per category and...
Definition shortcutsconfigpage.cpp:129
void filterRows(const QString &filter_text)
ShortcutsConfigPage::filterRows Re-run the combined text + quick filter whenever the search box chang...
Definition shortcutsconfigpage.cpp:181
void applyFilter()
ShortcutsConfigPage::applyFilter Hide every row that doesn't match both the search box and the quick ...
Definition shortcutsconfigpage.cpp:205
QuickFilter
Definition shortcutsconfigpage.h:58
@ ConflictsOnly
Definition shortcutsconfigpage.h:62
@ BoundOnly
Definition shortcutsconfigpage.h:60
@ ShowAll
Definition shortcutsconfigpage.h:59
@ UnboundOnly
Definition shortcutsconfigpage.h:61
QList< Row > m_rows
Definition shortcutsconfigpage.h:83
void checkConflicts()
ShortcutsConfigPage::checkConflicts Highlight every row whose currently-edited sequence is shared,...
Definition shortcutsconfigpage.cpp:277
QLabel * m_count_label
Definition shortcutsconfigpage.h:81
ShortcutsConfigPage(QWidget *parent=nullptr)
ShortcutsConfigPage::ShortcutsConfigPage.
Definition shortcutsconfigpage.cpp:63
Definition shortcutsconfigpage.h:65
QString description
Definition shortcutsconfigpage.h:68
QString id
Definition shortcutsconfigpage.h:66
QKeySequenceEdit * edit
Definition shortcutsconfigpage.h:70
QTreeWidgetItem * item
Definition shortcutsconfigpage.h:71
QString category
Definition shortcutsconfigpage.h:67
bool conflicted
Definition shortcutsconfigpage.h:72
QKeySequence default_sequence
Definition shortcutsconfigpage.h:69