24 : QToolBar(parent), m_editorActions(editorActions)
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,
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"));
43 addAction(add_canvas_action);
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,
51 addAction(merge_canvases_action);
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"));
58 addAction(delete_action);
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"));
67 addAction(undo_action);
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"));
74 addAction(redo_action);
76 auto empty =
new QWidget(
this);
77 empty->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
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);
Actions for ImportDataEditor.
bool isUndoEnabled() const
void onAddCanvas()
Create new canvas and append it to the end of canvas container.
void onImportDialogRequest()
void onDeleteItem()
Delete currently selected items.
void onMergeCanvases()
Merge selected canvases. All graphs will appear below canvas selected first.
DAREFLCORE_EXPORT void SetToolBarStyleTextBesides(QToolBar *toolbar)
Set common style for a toolbar.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.