Skip to main content

DataImport_Widget

DataImport_Widget

Main container widget for data import functionality. More…

#include <DataImport_Widget.hpp>

Inherits from QWidget, DataFocusAware

Public Signals

Name
void importCompleted(QString const & data_key, QString const & data_type)
Emitted when an import operation completes successfully.

Public Functions

Name
DataImport_Widget(std::shared_ptr< DataImportWidgetState > state, std::shared_ptr< DataManager > data_manager, SelectionContext * selection_context, QWidget * parent =[nullptr])
Construct the DataImport_Widget.
~DataImport_Widget() override
virtual void onDataFocusChanged(EditorLib::SelectedDataKey const & data_key, QString const & data_type) override
Handle data focus changes from SelectionContext.
std::shared_ptr< DataImportWidgetState > state() const
Get the state object.

Additional inherited members

Public Functions inherited from DataFocusAware

Name
virtual ~DataFocusAware() =default

Protected Functions inherited from DataFocusAware

Name
template <typename Receiver >
void
connectToSelectionContext(SelectionContext * ctx, Receiver * receiver)
Helper to connect this widget to SelectionContext.

Detailed Description

class DataImport_Widget;

Main container widget for data import functionality.

DataImport_Widget provides:

  1. Automatic type switching based on SelectionContext data focus
  2. Manual type selection via combo box
  3. Lazy-loaded, cached type-specific import widgets
  4. State persistence via DataImportWidgetState

Usage


// Create state and widget
auto state = std::make_shared<DataImportWidgetState>();
auto widget = new DataImport_Widget(state, data_manager, selection_context, this);

// Widget automatically responds to data focus changes
// User can also manually select data type via combo box

Public Signals Documentation

signal importCompleted

void importCompleted(
    QString const & data_key,
    QString const & data_type
)

Emitted when an import operation completes successfully.

Parameters:

  • data_key Key of the newly imported data in DataManager
  • data_type Type of the imported data

Public Functions Documentation

function DataImport_Widget

explicit DataImport_Widget(
    std::shared_ptr< DataImportWidgetState > state,
    std::shared_ptr< DataManager > data_manager,
    SelectionContext * selection_context,
    QWidget * parent =nullptr
)

Construct the DataImport_Widget.

Parameters:

  • state State object for persistence and change tracking
  • data_manager DataManager for data access
  • selection_context SelectionContext for data focus awareness
  • parent Parent widget

function ~DataImport_Widget

~DataImport_Widget() override

function onDataFocusChanged

virtual void onDataFocusChanged(
    EditorLib::SelectedDataKey const & data_key,
    QString const & data_type
) override

Handle data focus changes from SelectionContext.

Parameters:

  • data_key The newly focused data key (may be invalid)
  • data_type The type of the focused data (e.g., “LineData”)

Reimplements: DataFocusAware::onDataFocusChanged

Switches the stacked widget to show the appropriate import widget for the focused data type.

function state

inline std::shared_ptr< DataImportWidgetState > state() const

Get the state object.

Return: Shared pointer to state


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