Sun, 09 Apr 2023 15:59:08 +0300
Extracted the state of the program into a MainState structure, and extracted local functions of main() into static functions.
I was planning to make the core logic and state of the program into a Main class, which would be a QObject that would
have lots of signals and slots, but it looks like this works even without it
16 | 1 | #pragma once |
2 | #include <QWidget> | |
3 | #include <QAbstractTableModel> | |
4 | ||
5 | class KeyboardShortcutsEditor : public QAbstractTableModel | |
6 | { | |
7 | Q_OBJECT | |
8 | public: | |
9 | enum Column | |
10 | { | |
11 | TitleColumn, | |
12 | ShortcutColumn, | |
13 | }; | |
14 | explicit KeyboardShortcutsEditor(QObject* subject, QObject* parent = nullptr); | |
15 | int rowCount(const QModelIndex&) const override; | |
16 | int columnCount(const QModelIndex&) const override; | |
17 | QVariant data(const QModelIndex& index, int role) const override; | |
18 | QVariant headerData(int section, Qt::Orientation orientation, int role) const override; | |
19 | private: | |
259
c27612f0eac0
- Made it build under Qt6
Teemu Piippo <teemu.s.piippo@gmail.com>
parents:
16
diff
changeset
|
20 | const std::vector<QAction*> actions; |
16 | 21 | }; |