BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
gui2::ImportDataEditorToolBar Class Reference

Toolbar for ImportDataEditor. More...

Inheritance diagram for gui2::ImportDataEditorToolBar:
[legend]
Collaboration diagram for gui2::ImportDataEditorToolBar:
[legend]

Signals

void updateViewportRequest ()
 

Public Member Functions

 ImportDataEditorToolBar (ImportDataEditorActions *editorActions, QWidget *parent=nullptr)
 

Private Attributes

ImportDataEditorActionsm_editorActions {nullptr}
 

Detailed Description

Toolbar for ImportDataEditor.

Definition at line 27 of file importdataeditortoolbal.h.

Constructor & Destructor Documentation

◆ ImportDataEditorToolBar()

gui2::ImportDataEditorToolBar::ImportDataEditorToolBar ( ImportDataEditorActions editorActions,
QWidget *  parent = nullptr 
)

Definition at line 22 of file importdataeditortoolbal.cpp.

24  : QToolBar(parent), m_editorActions(editorActions)
25 {
27 
28  auto action = new QAction("Import", this);
29  action->setToolTip("Opens the data import dialog.");
30  action->setIcon(QIcon(":/icons/import.svg"));
31  connect(action, &QAction::triggered, this,
32  [this]() { m_editorActions->onImportDialogRequest(); });
33  addAction(action);
34 
35  addSeparator();
36 
37  auto add_canvas_action = new QAction("Add canvas", this);
38  add_canvas_action->setToolTip(
39  "Creates an empty canvas and appends it to the list.\n"
40  "Canvas can hold multiple graphs, graphs can be moved between canvas.");
41  add_canvas_action->setIcon(QIcon(":/icons/plus-box-outline.svg"));
42  connect(add_canvas_action, &QAction::triggered, [this]() { m_editorActions->onAddCanvas(); });
43  addAction(add_canvas_action);
44 
45  auto merge_canvases_action = new QAction("Merge", this);
46  merge_canvases_action->setToolTip("Merge several selected canvases into one.\n"
47  "All graphs will appear on a single canvas.");
48  merge_canvases_action->setIcon(QIcon(":/icons/set-merge.svg"));
49  connect(merge_canvases_action, &QAction::triggered,
50  [this]() { m_editorActions->onMergeCanvases(); });
51  addAction(merge_canvases_action);
52 
53  auto delete_action = new QAction("Remove", this);
54  delete_action->setToolTip("Remove the currently selected item,\n"
55  "single graph or canvas with whole content.");
56  delete_action->setIcon(QIcon(":/icons/beaker-remove-outline.svg"));
57  connect(delete_action, &QAction::triggered, [this]() { m_editorActions->onDeleteItem(); });
58  addAction(delete_action);
59 
60  addSeparator();
61 
62  auto undo_action = new QAction("Undo", this);
63  undo_action->setToolTip("Undo the action last performed.");
64  undo_action->setIcon(QIcon(":/icons/undo.svg"));
65  undo_action->setEnabled(editorActions->isUndoEnabled());
66  connect(undo_action, &QAction::triggered, [this]() { m_editorActions->onUndo(); });
67  addAction(undo_action);
68 
69  auto redo_action = new QAction("Redo", this);
70  redo_action->setToolTip("Redo the action just performed.");
71  redo_action->setIcon(QIcon(":/icons/redo.svg"));
72  redo_action->setEnabled(editorActions->isUndoEnabled());
73  connect(redo_action, &QAction::triggered, [this]() { m_editorActions->onRedo(); });
74  addAction(redo_action);
75 
76  auto empty = new QWidget(this);
77  empty->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
78  addWidget(empty);
79 
80  auto reset_graph_action = new QAction("Replot", this);
81  reset_graph_action->setToolTip("Set plot axes to default range");
82  reset_graph_action->setIcon(QIcon(":/icons/aspect-ratio.svg"));
83  connect(reset_graph_action, &QAction::triggered, this,
85  addAction(reset_graph_action);
86 }
void onAddCanvas()
Create new canvas and append it to the end of canvas container.
void onDeleteItem()
Delete currently selected items.
void onMergeCanvases()
Merge selected canvases. All graphs will appear below canvas selected first.
ImportDataEditorActions * m_editorActions
DAREFLCORE_EXPORT void SetToolBarStyleTextBesides(QToolBar *toolbar)
Set common style for a toolbar.
Definition: styleutils.cpp:39

References gui2::ImportDataEditorActions::isUndoEnabled(), m_editorActions, gui2::ImportDataEditorActions::onAddCanvas(), gui2::ImportDataEditorActions::onDeleteItem(), gui2::ImportDataEditorActions::onImportDialogRequest(), gui2::ImportDataEditorActions::onMergeCanvases(), gui2::ImportDataEditorActions::onRedo(), gui2::ImportDataEditorActions::onUndo(), gui2::StyleUtils::SetToolBarStyleTextBesides(), and updateViewportRequest().

Here is the call graph for this function:

Member Function Documentation

◆ updateViewportRequest

void gui2::ImportDataEditorToolBar::updateViewportRequest ( )
signal

Member Data Documentation

◆ m_editorActions

ImportDataEditorActions* gui2::ImportDataEditorToolBar::m_editorActions {nullptr}
private

Definition at line 37 of file importdataeditortoolbal.h.

Referenced by ImportDataEditorToolBar().


The documentation for this class was generated from the following files: