BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
dataloaderdialog.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/dataloader/dataloaderdialog.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_DATALOADER_DATALOADERDIALOG_H
16 #define BORNAGAIN_GUI2_DATALOADER_DATALOADERDIALOG_H
17 
18 #include "darefl_export.h"
20 #include <QDialog>
21 #include <memory>
22 #include <vector>
23 
24 class QSplitter;
25 
26 namespace gui2 {
27 
28 class DataLoaderToolBar;
29 class LoaderSelectorPanel;
30 class LoaderPreviewPanel;
31 class DataHandler;
32 
33 //! Main dialog for the data loader.
34 
35 class DAREFLCORE_EXPORT DataLoaderDialog : public QDialog {
36  Q_OBJECT
37 
38 public:
39  DataLoaderDialog(QWidget* parent = nullptr);
41 
42  std::vector<GraphImportData> graphImportData() const;
43 
44  void setTargetCanvas(const std::vector<std::string>& canvas_names, int current_index);
45 
46  int targetCanvasIndex() const;
47 
48  void invokeFileSelectorDialog();
49 
50  QStringList fileNames() const;
51 
52 protected:
53  void keyPressEvent(QKeyEvent* event) override;
54  void accept() override;
55 
56 private slots:
57  void onLoadFilesRequest();
58  void onShowFilePreviewRequest();
59  void onParseAllRequest();
60 
61 private:
62  void readSettings();
63  void writeSettings();
64  void initConnections();
65 
66  DataLoaderToolBar* m_toolBar{nullptr};
67  LoaderSelectorPanel* m_selectorPanel{nullptr};
68  LoaderPreviewPanel* m_previewPanel{nullptr};
69  QSplitter* m_splitter{nullptr};
70 
71  std::unique_ptr<DataHandler> m_dataHandler;
72  std::vector<GraphImportData> m_graphImportData;
73 };
74 
75 } // namespace gui2
76 
77 #endif // BORNAGAIN_GUI2_DATALOADER_DATALOADERDIALOG_H
Main dialog for the data loader.
std::vector< GraphImportData > m_graphImportData
std::unique_ptr< DataHandler > m_dataHandler
Tool bar for DataLoaderDialog.
Panel with settings for DataLoaderDialog.
Panel with settings for DataLoaderDialog.
Defines class CLASS?
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20