BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
TestComponentView.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/PropertyEditor/TestComponentView.h
6 //! @brief Defines class TestComponentView
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_PROPERTYEDITOR_TESTCOMPONENTVIEW_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_PROPERTYEDITOR_TESTCOMPONENTVIEW_H
17 
18 #include <QWidget>
19 
20 class MainWindow;
21 class QPushButton;
22 class QTreeView;
23 class SampleModel;
25 class QItemSelection;
26 class ComponentEditor;
27 class ComponentTreeView;
28 class QBoxLayout;
29 class QSplitter;
30 class ComponentFlatView;
31 class MaterialModel;
32 
33 //! View to tests QListView working with ComponentProxyModel.
34 
35 class TestComponentView : public QWidget {
36  Q_OBJECT
37 public:
38  TestComponentView(MainWindow* mainWindow = nullptr);
39 
40 private slots:
41  void onUpdateRequest();
42  void onAddItemRequest();
43  void onExpandRequest();
44 
45 private:
46  void init_source();
47  void onSelectionChanged(const QItemSelection& selected, const QItemSelection&);
48  QWidget* componentTreePanel();
49  QWidget* componentBoxPanel();
50 
54  QTreeView* m_sourceTree;
57  QPushButton* m_updateButton;
58  QPushButton* m_addItemButton;
59  QPushButton* m_expandButton;
60  QSplitter* m_splitter;
63 };
64 
65 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_PROPERTYEDITOR_TESTCOMPONENTVIEW_H
Component editor for SessionItem.
Component property widget for SessionItems.
Component property tree for SessionItems.
Main model to hold sample items.
Definition: SampleModel.h:24
The SessionModelDelegate class presents the content of SessionModel items in standard QTreeView.
View to tests QListView working with ComponentProxyModel.
void init_source()
Inserts test items into source model.
MainWindow * m_mainWindow
ComponentEditor * m_componentTree
QWidget * componentBoxPanel()
QPushButton * m_updateButton
void onSelectionChanged(const QItemSelection &selected, const QItemSelection &)
QTreeView * m_sourceTree
QWidget * componentTreePanel()
SessionModelDelegate * m_delegate
TestComponentView(MainWindow *mainWindow=nullptr)
QSplitter * m_splitter
QPushButton * m_expandButton
MaterialModel * m_materialModel
ComponentEditor * m_componentFlat
SampleModel * m_sampleModel
QPushButton * m_addItemButton