BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
RealDataSelectorWidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/ImportDataWidgets/RealDataSelectorWidget.h
6 //! @brief Defines class RealDataSelectorWidget
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_IMPORTDATAWIDGETS_REALDATASELECTORWIDGET_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_IMPORTDATAWIDGETS_REALDATASELECTORWIDGET_H
17 
18 #include <QWidget>
19 
21 class RealDataItemSelectorWidget;
22 class InstrumentModel;
23 class RealDataModel;
24 class SessionItem;
25 class RealDataSelectorActions;
26 class RealDataItem;
27 class RealDataTreeModel;
28 class QItemSelection;
29 class QTreeView;
30 
31 //! The RealDataSelectorWidget represents left panel of ImportDataView. Contains a tree to
32 //! select data set (m_itemTree & m_itemTreeModel) and properties of currently selected data
33 //! (RealDataPropertiesWidget).
34 
35 class RealDataSelectorWidget : public QWidget {
36  Q_OBJECT
37 
38 public:
39  RealDataSelectorWidget(QWidget* parent = 0);
40 
41  virtual QSize sizeHint() const override;
42  virtual QSize minimumSizeHint() const override;
43 
44  void setModel(RealDataModel* realDataModel);
45 
47  void setCurrentItem(RealDataItem* item);
48 
49 signals:
51 
52 protected:
53  virtual void showEvent(QShowEvent*) override;
54 
55 private:
56  void onSelectionChanged();
57  void renameCurrentItem();
58  void removeCurrentItem();
59  void rotateCurrentItem();
60  void updateActionEnabling();
61  void updateActionEnabling(const RealDataItem* item);
62  void onContextMenuRequest(const QPoint& point);
63  void importData(int ndim);
64  QModelIndex currentIndex();
65 
66 private:
67  QTreeView* m_itemTree;
75 };
76 
77 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_IMPORTDATAWIDGETS_REALDATASELECTORWIDGET_H
The RealDataItem class represents intensity data imported from file and intended for fitting.
Definition: RealDataItem.h:35
The RealDataModel class is a model to store all imported RealDataItem's.
Definition: RealDataModel.h:26
The RealDataPropertiesWidget class holds instrument selector to link with RealDataItem.
The RealDataSelectorWidget represents left panel of ImportDataView.
void setModel(RealDataModel *realDataModel)
void setCurrentItem(RealDataItem *item)
RealDataTreeModel * m_itemTreeModel
void onContextMenuRequest(const QPoint &point)
virtual QSize minimumSizeHint() const override
virtual void showEvent(QShowEvent *) override
RealDataPropertiesWidget * m_propertiesWidget
RealDataSelectorWidget(QWidget *parent=0)
void selectionChanged(SessionItem *)
virtual QSize sizeHint() const override
Tree model for real data item selection. Used for the tree in the import view.