BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
MaterialEditorToolBar.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/MaterialEditor/MaterialEditorToolBar.h
6 //! @brief Defines class MaterialEditorToolBar
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_MATERIALEDITOR_MATERIALEDITORTOOLBAR_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_MATERIALEDITOR_MATERIALEDITORTOOLBAR_H
17 
18 #include <QToolBar>
19 
20 class QAction;
21 class MaterialModel;
22 class QItemSelectionModel;
23 class QPoint;
24 class QMenu;
25 
26 //! Toolbar for MaterialEditor.
27 
28 class MaterialEditorToolBar : public QToolBar {
29  Q_OBJECT
30 public:
31  MaterialEditorToolBar(MaterialModel* materialModel, QWidget* parent = nullptr);
32 
33  void setSelectionModel(QItemSelectionModel* selectionModel);
34 
35 public slots:
36  void onCustomContextMenuRequested(const QPoint& point);
37 
38 private slots:
39  void onNewMaterialAction();
40  void onCloneMaterialAction();
42 
43 private:
44  void initItemContextMenu(QMenu& menu);
45 
47  QItemSelectionModel* m_selectionModel;
51 };
52 
53 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_MATERIALEDITOR_MATERIALEDITORTOOLBAR_H
Toolbar for MaterialEditor.
MaterialEditorToolBar(MaterialModel *materialModel, QWidget *parent=nullptr)
void setSelectionModel(QItemSelectionModel *selectionModel)
QItemSelectionModel * m_selectionModel
void onCustomContextMenuRequested(const QPoint &point)
MaterialModel * m_materialModel
void initItemContextMenu(QMenu &menu)