28 #include <QVBoxLayout>
43 auto layout =
new QVBoxLayout(
this);
44 layout->setContentsMargins(0, 0, 0, 0);
46 auto splitter =
new QSplitter;
49 splitter->setSizes(QList<int>() << 150 << 300);
52 layout->addWidget(splitter);
67 auto on_selection_changed = [
this]() {
89 if (dialog.exec() == QDialog::Accepted) {
90 auto canvases = Utils::FindItems<CanvasItem>(
m_dataModel);
102 std::vector<std::string> names;
103 auto canvases = Utils::FindItems<CanvasItem>(
m_dataModel);
105 std::transform(canvases.begin(), canvases.end(), std::back_inserter(names),
106 [](
auto x) { return x->displayName(); });
115 for (
auto& data : graph_data)
void setRootSessionItem(SessionItem *item)
Holds a collection of GraphItem's for simultaneous plotting, as well as all information related to pl...
Main dialog for the data loader.
int targetCanvasIndex() const
Returns index of target canvas for graph import.
void setTargetCanvas(const std::vector< std::string > &canvas_names, int current_index)
Set list of target canvas to define entr where to import.
QStringList fileNames() const
std::vector< GraphImportData > graphImportData() const
Returns the result of whole parsing.
void invokeFileSelectorDialog()
Invokes file selector dialog.
Custom selection model for data view model (AbstractViewModel).
CanvasItem * activeCanvas() const
Returns active canvas.
void selectItem(ModelView::SessionItem *item)
Set the selection on a single item.
View model for ExperimentalDataModel with drag-and-drop support.
The model to store imported reflectometry data.
CanvasContainerItem * canvasContainer() const
Returns the canvas container of the model.
ModelView::GraphItem * addGraph(const GraphImportData &graph_data, CanvasItem &target_canvas)
Adds graph to 'target_canvas' and returns the result.
Actions for ImportDataEditor.
void setSelectionModel(DataSelectionModel *selection_model)
void invokeImportDialogRequest()
void onImportDialogAccept(const std::vector< GraphImportData > &graph_data, CanvasItem *canvas)
DataSelectorWidget * m_dataSelectorWidget
ImportDataEditorActions * m_editorActions
GraphCanvasWidget * m_graphCanvasWidget
ExperimentalDataModel * m_dataModel
DataViewModel * m_viewModel
ImportDataEditorToolBar * m_editorToolBar
std::pair< std::vector< std::string >, int > canvasInfo() const
Returns vector of canvas display name together with index of currently selected canvas.
DataSelectionModel * selectionModel() const
void invokeImportDialog()
Invoke the data load dialog and connect its state.
int IndexOfItem(It begin, It end, const T &item)
Returns index corresponding to the first occurance of the item in the container.
materialitems.h Collection of materials to populate MaterialModel.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.