JustAnotherDnDGame 0.1.0
Jeu de rôle tactique au d20, vue de dessus, en C++/Qt
Loading...
Searching...
No Matches
EditorKeybindingsWidget.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: 2026 Valentin Eloy
2// SPDX-License-Identifier: GPL-3.0-or-later
3
4#pragma once
5
6#include <QWidget>
7#include <array>
8#include <filesystem>
9
11
17
18class QFormLayout;
19class QLabel;
20class QPushButton;
21
22namespace hmi {
23
24class Localization;
25
37class EditorKeybindingsWidget : public QWidget {
38 Q_OBJECT
39
40public:
41 EditorKeybindingsWidget(hmi::EditorKeyBindings& bindings, std::filesystem::path savePath,
42 QWidget* parent = nullptr);
43
45 void retranslateUi(const Localization& loc);
46
47signals:
50
51protected:
52 void keyPressEvent(QKeyEvent* event) override;
53
54private:
55 void refresh();
56
58 std::filesystem::path _savePath;
59 int _capturing = -1;
60 std::array<QPushButton*, hmi::EDITOR_ACTION_COUNT> _buttons{};
61 std::array<QLabel*, hmi::EDITOR_ACTION_COUNT> _actionLabels{};
62 QLabel* _help = nullptr;
63 const Localization* _loc = nullptr;
64};
65
66} // namespace hmi
Association remappable action d'éditeur -> touche clavier, avec persistance (EX-CTRL-012).
Association action d'éditeur -> touche, avec persistance JSON (EX-CTRL-012, LOT-29).
Definition EditorKeyBindings.h:53
void refresh()
Definition EditorKeybindingsWidget.cpp:72
void bindingsChanged()
Émis après chaque remappage réussi (touche capturée et sauvegardée).
hmi::EditorKeyBindings & _bindings
Definition EditorKeybindingsWidget.h:57
const Localization * _loc
Definition EditorKeybindingsWidget.h:63
std::array< QPushButton *, hmi::EDITOR_ACTION_COUNT > _buttons
Definition EditorKeybindingsWidget.h:60
int _capturing
Indice de l'action en cours de capture, ou -1.
Definition EditorKeybindingsWidget.h:59
std::filesystem::path _savePath
Definition EditorKeybindingsWidget.h:58
void keyPressEvent(QKeyEvent *event) override
Definition EditorKeybindingsWidget.cpp:89
void retranslateUi(const Localization &loc)
Applique la langue active (libellés d'actions, invite de capture, aide).
Definition EditorKeybindingsWidget.cpp:79
QLabel * _help
Definition EditorKeybindingsWidget.h:62
EditorKeybindingsWidget(hmi::EditorKeyBindings &bindings, std::filesystem::path savePath, QWidget *parent=nullptr)
Definition EditorKeybindingsWidget.cpp:37
std::array< QLabel *, hmi::EDITOR_ACTION_COUNT > _actionLabels
Definition EditorKeybindingsWidget.h:61
Catalogue de traduction (i18n) : associe des clés stables à des chaînes selon la langue active,...
Definition Localization.h:29
Definition AudioEngine.cpp:15