BornAgain  1.19.79
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/View/Import/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_VIEW_IMPORT_REALDATASELECTORWIDGET_H
16 #define BORNAGAIN_GUI_VIEW_IMPORT_REALDATASELECTORWIDGET_H
17 
18 #include <QModelIndex>
19 #include <QWidget>
20 #include <functional>
21 
23 class RealDataItemSelectorWidget;
25 class RealDataModel;
26 class SessionItem;
27 class RealDataSelectorActions;
28 class RealDataItem;
29 class RealDataTreeModel;
30 class QItemSelection;
31 class QTreeView;
32 class ProjectDocument;
33 
34 //! The RealDataSelectorWidget represents left panel of ImportDataView. Contains a tree to
35 //! select data set (m_itemTree & m_itemTreeModel) and properties of currently selected data
36 //! (RealDataPropertiesWidget).
37 
38 class RealDataSelectorWidget : public QWidget {
39  Q_OBJECT
40 
41 public:
42  RealDataSelectorWidget(QWidget* parent, ProjectDocument* document);
43 
44  QSize sizeHint() const override;
45  QSize minimumSizeHint() const override;
46 
48  void setCurrentItem(RealDataItem* item);
49 
50 signals:
52 
53 private:
54  void onSelectionChanged();
55  void renameCurrentItem();
56  void removeCurrentItem();
57  void updateActionEnabling();
58  void updateActionEnabling(const RealDataItem* item) const;
59  void updateFunctionalities();
60  void onContextMenuRequest(const QPoint& point);
61  void importData1D();
62  void importData2D();
63  QModelIndex currentIndex();
64 
65  QList<QAction*> getOverlayActions(const QModelIndex& index, bool asHover);
66 
67 private:
68  QTreeView* m_itemTree;
71 
73 
74 public:
79 };
80 
81 #endif // BORNAGAIN_GUI_VIEW_IMPORT_REALDATASELECTORWIDGET_H
Project document class handles all data related to the opened project (sample, job,...
Provides access to experimental data, for display and fitting. Owns an AbstractDataLoader.
Definition: RealDataItem.h:33
The RealDataModel class is a model to store all imported RealDataItem's.
Definition: RealDataModel.h:24
The RealDataPropertiesWidget class holds instrument selector to link with RealDataItem....
The RealDataSelectorWidget represents left panel of ImportDataView. Contains a tree to select data se...
void selectionChanged(RealDataItem *)
RealDataSelectorWidget(QWidget *parent, ProjectDocument *document)
void setCurrentItem(RealDataItem *item)
RealDataTreeModel * m_itemTreeModel
void onContextMenuRequest(const QPoint &point)
QSize minimumSizeHint() const override
QList< QAction * > getOverlayActions(const QModelIndex &index, bool asHover)
RealDataPropertiesWidget * m_propertiesWidget
QSize sizeHint() const override
Tree model for real data item selection. Used for the tree in the import view.
Base class for a GUI data item.
Definition: SessionItem.h:204