BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
SpecularDataImportWidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/coregui/Views/SpecularDataWidgets/SpecularDataImportWidget.h
6 //! @brief Defines class SpecularDataImportWidget
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_VIEWS_SPECULARDATAWIDGETS_SPECULARDATAIMPORTWIDGET_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_SPECULARDATAWIDGETS_SPECULARDATAIMPORTWIDGET_H
17 
20 #include "qcustomplot.h"
21 #include <memory>
22 
23 class SpecularDataItem;
24 class AbstractDataLoader;
25 class RealDataItem;
26 
27 namespace Ui {
29 }
30 
31 //! Widget to define and show 1D (specular) imports by data loaders, e.g. CSV file import
32 //! Contains space for the loader-defined import properties, a table for the raw and the imported
33 //! data and a graph to show the plot of the imported data.
34 //! The UI is defined via QtDesigner (.ui file)
35 
37  Q_OBJECT
38 
39 public:
40  SpecularDataImportWidget(QWidget* parent = nullptr);
41 
43 
44  QList<QAction*> actionList();
45 
46 private slots:
47  void onContextMenuRequest(const QPoint& point);
48  void onPlotAxisClicked(QCPAxis* axis, QCPAxis::SelectablePart part, QMouseEvent* event);
49 
50 private:
52  const RealDataItem* realDataItem() const;
54 
55  void fillLoaderCombo();
56  void updatePropertiesEdits();
59  void updatePreview();
61  void onPropertiesChanged();
62  QString currentFileName() const;
63 
64  Ui::SpecularDataImportWidget* m_ui;
65  AbstractDataLoader1D* m_loader; // only borrowed from realDataItem. Do not delete!
66 };
67 
68 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_SPECULARDATAWIDGETS_SPECULARDATAIMPORTWIDGET_H
Defines class AbstractDataLoader1D.
Defines class ItemComboWidget.
Base class for data loaders for 1D import.
Base class for all data loaders (classes which can import real data)
The RealDataItem class represents intensity data imported from file and intended for fitting.
Definition: RealDataItem.h:35
The SessionItemWidget class is a base for all widgets representing the content of SessionItem.
Widget to define and show 1D (specular) imports by data loaders, e.g.
Ui::SpecularDataImportWidget * m_ui
AbstractDataLoader1D * m_loader
void onPlotAxisClicked(QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
AbstractDataLoader * selectedLoader()
void setItem(SessionItem *realDataItem)
SpecularDataImportWidget(QWidget *parent=nullptr)
void onContextMenuRequest(const QPoint &point)
const RealDataItem * realDataItem() const