BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SampleTreeWidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/SampleDesigner/SampleTreeWidget.h
6 //! @brief Defines class SampleTreeWidget
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_SAMPLEDESIGNER_SAMPLETREEWIDGET_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_SAMPLETREEWIDGET_H
17 
18 #include <QMap>
19 #include <QWidget>
20 
21 class ItemTreeView;
22 class SampleModel;
23 class QTreeView;
24 class QPoint;
25 class QAction;
26 
27 //! Holds tree to select top level sample items. Part of SampleView.
28 
29 class SampleTreeWidget : public QWidget {
30  Q_OBJECT
31 public:
32  SampleTreeWidget(QWidget* parent, SampleModel* model);
33 
34  QTreeView* treeView();
35 
36 protected slots:
37  void showContextMenu(const QPoint& pnt);
38  void addItem(const QString& item_name);
39  void deleteItem();
40 
41 private:
42  void scrollToIndex(const QModelIndex& index);
43  QModelIndex getIndexAtColumnZero(const QModelIndex& index);
44 
45  QMap<QString, QAction*> m_add_action_map;
47 
50 };
51 
52 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_SAMPLEDESIGNER_SAMPLETREEWIDGET_H
Main model to hold sample items.
Definition: SampleModel.h:24
Holds tree to select top level sample items. Part of SampleView.
QMap< QString, QAction * > m_add_action_map
SampleTreeWidget(QWidget *parent, SampleModel *model)
SampleModel * m_sampleModel
void addItem(const QString &item_name)
void scrollToIndex(const QModelIndex &index)
QTreeView * treeView()
QAction * m_delete_item_action
ItemTreeView * m_treeView
QModelIndex getIndexAtColumnZero(const QModelIndex &index)
void showContextMenu(const QPoint &pnt)