BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
materialeditortoolbar.cpp
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/materialeditor/materialeditortoolbar.cpp
6 //! @brief Implements class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
18 #include <QAction>
19 #include <QToolButton>
20 
21 namespace gui2 {
22 
24  : QToolBar(parent)
25 {
27 
28  auto action = new QAction("Add material", this);
29  action->setIcon(QIcon(":/icons/plus-circle-outline.svg"));
30  action->setToolTip("Adds new material at the bottom of the list");
31  connect(action, &QAction::triggered, actions, &MaterialEditorActions::onAddMaterial);
32  addAction(action);
33 
34  action = new QAction("Clone", this);
35  action->setIcon(QIcon(":/icons/plus-circle-multiple-outline.svg"));
36  action->setToolTip("Clones selected material");
37  connect(action, &QAction::triggered, actions, &MaterialEditorActions::onCloneMaterial);
38  addAction(action);
39 
40  action = new QAction("Remove", this);
41  action->setIcon(QIcon(":/icons/beaker-remove-outline.svg"));
42  action->setToolTip("Removes selected material");
43  connect(action, &QAction::triggered, actions, &MaterialEditorActions::onRemoveMaterial);
44  addAction(action);
45 
46  addSeparator();
47 
48  action = new QAction("Up", this);
49  action->setIcon(QIcon(":/icons/arrow-up-circle-outline.svg"));
50  action->setToolTip("Moves selected material up");
51  connect(action, &QAction::triggered, actions, &MaterialEditorActions::onMoveUp);
52  addAction(action);
53 
54  action = new QAction("Down", this);
55  action->setIcon(QIcon(":/icons/arrow-down-circle-outline.svg"));
56  action->setToolTip("Moves selected material down");
57  connect(action, &QAction::triggered, actions, &MaterialEditorActions::onMoveDown);
58  addAction(action);
59 
60  addSeparator();
61 
62  action = new QAction("Import", this);
63  action->setIcon(QIcon(":/icons/import.svg"));
64  action->setToolTip("Imports materials from file");
65  connect(action, &QAction::triggered, actions, &MaterialEditorActions::onImport);
66  addAction(action);
67 
68  action = new QAction("Export", this);
69  action->setIcon(QIcon(":/icons/export.svg"));
70  action->setToolTip("Exports materials to file");
71  connect(action, &QAction::triggered, actions, &MaterialEditorActions::onExport);
72  addAction(action);
73 }
74 
75 } // namespace gui2
Handles user actions applied to material table.
void onCloneMaterial()
Processes request to clone selected materials.
MaterialEditorToolBar(MaterialEditorActions *actions, QWidget *parent=nullptr)
Defines class CLASS?
Defines class CLASS?
Defines class CLASS?
DAREFLCORE_EXPORT void SetToolBarStyleTextBesides(QToolBar *toolbar)
Set common style for a toolbar.
Definition: styleutils.cpp:39
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20