Skip to main content

KeybindingEditorState

KeybindingEditorState

Minimal EditorState for the KeybindingEditor widget. More…

#include <KeybindingEditorState.hpp>

Inherits from EditorState, QObject

Public Functions

Name
KeybindingEditorState(QObject * parent =[nullptr])
~KeybindingEditorState() override =default
virtual QString getTypeName() const override
Get unique type name for this editor state.
virtual std::string toJson() const override
Serialize state to JSON string.
virtual bool fromJson(std::string const & json) override
Restore state from JSON string.

Additional inherited members

Public Signals inherited from EditorState

Name
void stateChanged()
Emitted when any state property changes.
void displayNameChanged(QString const & newName)
Emitted when display name changes.
void dirtyChanged(bool isDirty)
Emitted when dirty state changes.

Public Functions inherited from EditorState

Name
EditorState(QObject * parent =[nullptr])
Construct a new EditorState.
~EditorState() override =default
Virtual destructor.
virtual QString getDisplayName() const
Get display name for UI.
virtual void setDisplayName(QString const & name)
Set display name.
QString getInstanceId() const
Get unique instance ID.
bool isDirty() const
Check if state has unsaved changes.
void markClean()
Mark state as clean (after save).

Protected Functions inherited from EditorState

Name
void markDirty()
Mark state as modified.
void setInstanceId(QString const & id)
Set instance ID (for deserialization).
QString generateInstanceId()
Generate a new unique instance ID.

Detailed Description

class KeybindingEditorState;

Minimal EditorState for the KeybindingEditor widget.

All persistent keybinding data is managed by KeymapManager via AppPreferencesData. This state class exists only to satisfy the EditorRegistry type system.

Public Functions Documentation

function KeybindingEditorState

explicit KeybindingEditorState(
    QObject * parent =nullptr
)

function ~KeybindingEditorState

~KeybindingEditorState() override =default

function getTypeName

inline virtual QString getTypeName() const override

Get unique type name for this editor state.

Return: Type name, e.g., “MediaWidget”, “DataViewerWidget”

Reimplements: EditorState::getTypeName

This is used for:

  • Factory registration
  • Serialization type field
  • Properties panel routing

function toJson

inline virtual std::string toJson() const override

Serialize state to JSON string.

Return: JSON string representation of state

Reimplements: EditorState::toJson

Subclasses should use reflect-cpp for serialization: ```cpp

std::string toJson() const override { return rfl::json::write(_data); }



### function fromJson

```cpp
inline virtual bool fromJson(
    std::string const & json
) override

Restore state from JSON string.

Parameters:

  • json JSON string to parse

Return: true if parsing succeeded, false on error

Reimplements: EditorState::fromJson

Subclasses should use reflect-cpp for deserialization: ```cpp

bool fromJson(std::string const& json) override { auto result = rfl::json::read(json); if (result) { _data = *result; emit stateChanged(); return true; } return false; } ```


Updated on 2026-11-13 at 20:25:40 +0000