Skip to main content

SelectionSource

SelectionSource

Identifies the source of a selection change. More…

#include <SelectionContext.hpp>

Public Functions

Name
bool operator==(SelectionSource const & other) const

Public Attributes

Name
EditorInstanceId editor_instance_id
Instance ID of the editor that made the selection.
QString widget_id
Specific widget within editor (optional, for compound editors).

Detailed Description

struct SelectionSource;

Identifies the source of a selection change.

When processing selection changes, widgets can check if the change came from themselves to avoid circular updates:


void MyWidget::onSelectionChanged(SelectionSource const& source) {
    if (source.editor_instance_id == _my_state->getInstanceId()) {
        return; // Ignore our own selection change
    }
    // Handle selection from other widget
}

Public Functions Documentation

function operator==

inline bool operator==(
    SelectionSource const & other
) const

Public Attributes Documentation

variable editor_instance_id

EditorInstanceId editor_instance_id;

Instance ID of the editor that made the selection.

variable widget_id

QString widget_id;

Specific widget within editor (optional, for compound editors).


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