JustAnotherDnDGame 0.1.0
Jeu de rôle tactique au d20, vue de dessus, en C++/Qt
Loading...
Searching...
No Matches
hmi::EditorKeybindingsWidget Class Reference

Widget de remappage des touches d'éditeur (EditorKeyBindings), destiné à l'onglet « Éditeur » de la page Options. More...

#include <EditorKeybindingsWidget.h>

Inheritance diagram for hmi::EditorKeybindingsWidget:

Signals

void bindingsChanged ()
 Émis après chaque remappage réussi (touche capturée et sauvegardée).

Public Member Functions

 EditorKeybindingsWidget (hmi::EditorKeyBindings &bindings, std::filesystem::path savePath, QWidget *parent=nullptr)
void retranslateUi (const Localization &loc)
 Applique la langue active (libellés d'actions, invite de capture, aide).

Protected Member Functions

void keyPressEvent (QKeyEvent *event) override

Private Member Functions

void refresh ()

Private Attributes

hmi::EditorKeyBindings_bindings
std::filesystem::path _savePath
int _capturing = -1
 Indice de l'action en cours de capture, ou -1.
std::array< QPushButton *, hmi::EDITOR_ACTION_COUNT_buttons {}
std::array< QLabel *, hmi::EDITOR_ACTION_COUNT_actionLabels {}
QLabel * _help = nullptr
const Localization_loc = nullptr

Detailed Description

Widget de remappage des touches d'éditeur (EditorKeyBindings), destiné à l'onglet « Éditeur » de la page Options.

Patron identique à KeybindingsWidget (touches de jeu) : chaque action affiche sa touche courante, cliquer capture la prochaine touche pressée (échange auto si déjà prise), persistée immédiatement dans le fichier partagé. bindingsChanged oblige l'appelant à resynchroniser les raccourcis effectifs des QAction (hmi::EditorActions::applyShortcuts) : ce widget écrit la liaison, il ne touche pas aux actions, et un remappage non resynchronisé resterait invisible dans le menu et la barre d'outils.

Constructor & Destructor Documentation

◆ EditorKeybindingsWidget()

hmi::EditorKeybindingsWidget::EditorKeybindingsWidget ( hmi::EditorKeyBindings & bindings,
std::filesystem::path savePath,
QWidget * parent = nullptr )

Member Function Documentation

◆ bindingsChanged

void hmi::EditorKeybindingsWidget::bindingsChanged ( )
signal

Émis après chaque remappage réussi (touche capturée et sauvegardée).

◆ keyPressEvent()

void hmi::EditorKeybindingsWidget::keyPressEvent ( QKeyEvent * event)
overrideprotected

◆ refresh()

void hmi::EditorKeybindingsWidget::refresh ( )
private

◆ retranslateUi()

void hmi::EditorKeybindingsWidget::retranslateUi ( const Localization & loc)

Applique la langue active (libellés d'actions, invite de capture, aide).

Member Data Documentation

◆ _actionLabels

std::array<QLabel*, hmi::EDITOR_ACTION_COUNT> hmi::EditorKeybindingsWidget::_actionLabels {}
private

◆ _bindings

hmi::EditorKeyBindings& hmi::EditorKeybindingsWidget::_bindings
private

◆ _buttons

std::array<QPushButton*, hmi::EDITOR_ACTION_COUNT> hmi::EditorKeybindingsWidget::_buttons {}
private

◆ _capturing

int hmi::EditorKeybindingsWidget::_capturing = -1
private

Indice de l'action en cours de capture, ou -1.

◆ _help

QLabel* hmi::EditorKeybindingsWidget::_help = nullptr
private

◆ _loc

const Localization* hmi::EditorKeybindingsWidget::_loc = nullptr
private

◆ _savePath

std::filesystem::path hmi::EditorKeybindingsWidget::_savePath
private

The documentation for this class was generated from the following files: