void setMaxEntries(int max)
Set the maximum number of entries to keep (circular buffer)
QString dumpHistory() const
Get a human-readable dump of the history.
QList< HistoryEntry > history() const
Get all history entries (oldest first)
void addEntry(const QString &stateName, TransitionReason reason, const QString &details=QString())
Manually add an entry (for custom transition types)
int count() const
Get the number of recorded entries.
QList< HistoryEntry > entriesForState(const QString &stateName) const
Get entries for a specific state.
QJsonArray toJson() const
Export history as JSON array.
void clear()
Clear all recorded history.
void setEnabled(bool enabled)
Enable or disable recording.
~StateHistoryRecorder() override=default
QList< HistoryEntry > lastEntries(int n) const
Get the last N entries.
TransitionReason
Reason for a state transition.
@ Timeout
Transition due to timeout.
@ Signal
Transition triggered by signal.
@ Event
Transition triggered by event.
void logHistory() const
Log history to debug output.
A recorded state transition entry.