BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
ModelTreeView.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/CommonWidgets/ModelTreeView.h
6 //! @brief Defines class ModelTreeView
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_COMMONWIDGETS_MODELTREEVIEW_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_COMMONWIDGETS_MODELTREEVIEW_H
17 
18 #include <QWidget>
19 
20 class QTreeView;
21 class SessionModel;
23 class QAbstractItemDelegate;
24 
25 //! Equivalent of QTreeView for SessionModel allowing to add visual decorations to the tree.
26 //! Additionaly provides expand/collapse utility methods.
27 
28 class ModelTreeView : public QWidget {
29  Q_OBJECT
30 public:
31  ModelTreeView(QWidget* parent, SessionModel* model);
32 
33  void setItemDelegate(QAbstractItemDelegate* delegate);
34 
35 public slots:
36  void toggleExpanded();
37  void setExpanded(bool expanded);
38  bool isExpanded() const { return m_is_expanded; }
39 
40 private:
41  QTreeView* m_tree;
44 };
45 
46 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_COMMONWIDGETS_MODELTREEVIEW_H
Equivalent of QTreeView for SessionModel allowing to add visual decorations to the tree.
Definition: ModelTreeView.h:28
QTreeView * m_tree
Definition: ModelTreeView.h:41
ModelTreeView(QWidget *parent, SessionModel *model)
void setItemDelegate(QAbstractItemDelegate *delegate)
void setExpanded(bool expanded)
void toggleExpanded()
SessionDecorationModel * m_decorationProxy
Definition: ModelTreeView.h:42
bool isExpanded() const
Definition: ModelTreeView.h:38
Provides decorations (text color, icons, etc) for SessionModel in SessionModelView context.