DataInspectorState
DataInspectorState
State class for DataInspector_Widget. More…
#include <DataInspectorState.hpp>
Inherits from EditorState, QObject
Public Signals
| Name | |
|---|---|
| void | inspectedDataKeyChanged(QString const & key) Emitted when the inspected data key changes. |
| void | inspectedTimeFrameKeyChanged(QString const & key) Emitted when the inspected TimeFrame key changes. |
| void | pinnedChanged(bool pinned) Emitted when pinned state changes. |
| void | sectionCollapsedChanged(QString const & section_id, bool collapsed) Emitted when a section’s collapsed state changes. |
Public Functions
| Name | |
|---|---|
| DataInspectorState(QObject * parent =[nullptr]) Construct a new DataInspectorState. |
|
| ~DataInspectorState() override =default | |
| virtual QString | getTypeName() const override Get the type name for this state. |
| virtual QString | getDisplayName() const override Get the display name for UI. |
| virtual void | setDisplayName(QString const & name) override Set the display name. |
| virtual std::string | toJson() const override Serialize state to JSON. |
| virtual bool | fromJson(std::string const & json) override Restore state from JSON. |
| void | setInspectedDataKey(QString const & key) Set the data key to inspect. |
| QString | inspectedDataKey() const Get the currently inspected data key. |
| void | setInspectedTimeFrameKey(QString const & key) Set the TimeFrame key to inspect. |
| QString | inspectedTimeFrameKey() const Get the currently inspected TimeFrame key. |
| void | setPinned(bool pinned) Set pinned state. |
| bool | isPinned() const Get pinned state. |
| void | setSectionCollapsed(QString const & section_id, bool collapsed) Set whether a UI section is collapsed. |
| bool | isSectionCollapsed(QString const & section_id) const Check if a UI section is collapsed. |
| void | setTypeSpecificState(nlohmann::json const & json) Store type-specific UI state as JSON. |
| nlohmann::json | getTypeSpecificState() const Get type-specific UI state. |
Public Attributes
| Name | |
|---|---|
| TimePosition | current_position |
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. |
|
| 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 DataInspectorState;State class for DataInspector_Widget.
DataInspectorState is an EditorState subclass that tracks the state of a data inspector widget. Each inspector inspects one data item.
Pinning Behavior
When unpinned (default), the inspector responds to SelectionContext changes and updates to show the newly selected data.
When pinned, the inspector ignores SelectionContext and continues to show its current data, allowing the user to compare data across selections.
Multiple Inspectors
Multiple DataInspector instances can exist simultaneously. Each has its own state and can be pinned independently.
Public Signals Documentation
signal inspectedDataKeyChanged
void inspectedDataKeyChanged(
QString const & key
)Emitted when the inspected data key changes.
Parameters:
- key The new data key
signal inspectedTimeFrameKeyChanged
void inspectedTimeFrameKeyChanged(
QString const & key
)Emitted when the inspected TimeFrame key changes.
Parameters:
- key The new TimeFrame key
signal pinnedChanged
void pinnedChanged(
bool pinned
)Emitted when pinned state changes.
Parameters:
- pinned The new pinned state
signal sectionCollapsedChanged
void sectionCollapsedChanged(
QString const & section_id,
bool collapsed
)Emitted when a section’s collapsed state changes.
Parameters:
- section_id The section that changed
- collapsed The new collapsed state
Public Functions Documentation
function DataInspectorState
explicit DataInspectorState(
QObject * parent =nullptr
)Construct a new DataInspectorState.
Parameters:
- parent Parent QObject (typically nullptr, managed by EditorRegistry)
function ~DataInspectorState
~DataInspectorState() override =defaultfunction getTypeName
inline virtual QString getTypeName() const overrideGet the type name for this state.
Return: “DataInspector”
Reimplements: EditorState::getTypeName
function getDisplayName
virtual QString getDisplayName() const overrideGet the display name for UI.
Return: User-visible name (default: “Data Inspector”)
Reimplements: EditorState::getDisplayName
function setDisplayName
virtual void setDisplayName(
QString const & name
) overrideSet the display name.
Parameters:
- name New display name
Reimplements: EditorState::setDisplayName
function toJson
virtual std::string toJson() const overrideSerialize state to JSON.
Return: JSON string representation
Reimplements: EditorState::toJson
function fromJson
virtual bool fromJson(
std::string const & json
) overrideRestore state from JSON.
Parameters:
- json JSON string to parse
Return: true if parsing succeeded
Reimplements: EditorState::fromJson
function setInspectedDataKey
void setInspectedDataKey(
QString const & key
)Set the data key to inspect.
Parameters:
- key Data key in DataManager (empty string to clear)
Setting a data key clears any inspected TimeFrame key.
function inspectedDataKey
QString inspectedDataKey() constGet the currently inspected data key.
Return: Data key, or empty string if none
function setInspectedTimeFrameKey
void setInspectedTimeFrameKey(
QString const & key
)Set the TimeFrame key to inspect.
Parameters:
- key TimeFrame key in DataManager (empty string to clear)
Setting a TimeFrame key clears any inspected data key.
function inspectedTimeFrameKey
QString inspectedTimeFrameKey() constGet the currently inspected TimeFrame key.
Return: TimeFrame key, or empty string if none
function setPinned
void setPinned(
bool pinned
)Set pinned state.
Parameters:
- pinned true to pin, false to respond to selection changes
When pinned, the inspector ignores SelectionContext updates.
function isPinned
bool isPinned() constGet pinned state.
Return: true if pinned
function setSectionCollapsed
void setSectionCollapsed(
QString const & section_id,
bool collapsed
)Set whether a UI section is collapsed.
Parameters:
- section_id Identifier for the section (e.g., “properties”, “export”)
- collapsed true if section should be collapsed
function isSectionCollapsed
bool isSectionCollapsed(
QString const & section_id
) constCheck if a UI section is collapsed.
Parameters:
- section_id Identifier for the section
Return: true if collapsed
function setTypeSpecificState
void setTypeSpecificState(
nlohmann::json const & json
)Store type-specific UI state as JSON.
Parameters:
- json JSON object with type-specific settings
function getTypeSpecificState
nlohmann::json getTypeSpecificState() constGet type-specific UI state.
Return: JSON object with type-specific settings
Public Attributes Documentation
variable current_position
TimePosition current_position;Updated on 2026-11-13 at 20:25:41 +0000