BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
loaderselectorpanel.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/dataloader/loaderselectorpanel.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_LOADERSELECTORPANEL_H
16 #define BORNAGAIN_GUI2_DATALOADER_LOADERSELECTORPANEL_H
17 
18 #include "darefl_export.h"
19 #include <QWidget>
20 #include <memory>
21 
22 class QSplitter;
23 
24 namespace gui2 {
25 
26 class ParserInterface;
27 class ImportFileWidget;
28 class ParserPropertyWidget;
29 
30 //! Panel with settings for DataLoaderDialog.
31 //! Located on its left side, contains file selection dialog and parser property widget.
32 
33 class DAREFLCORE_EXPORT LoaderSelectorPanel : public QWidget {
34  Q_OBJECT
35 
36 public:
37  LoaderSelectorPanel(QWidget* parent = nullptr);
39 
40  std::unique_ptr<ParserInterface> createParser() const;
41 
42  void setTargetCanvas(const QStringList& canvas_names, int current_index);
43 
44  int targetCanvasIndex() const;
45 
46 public slots:
47  void onAddFilesRequest();
48  void onRemoveFileRequest();
49  QStringList selectedFileNames() const;
50  QStringList fileNames() const;
51 
52 signals:
53  void fileNamesChanged(const QStringList& file_names);
54  void fileSelectionChanged(const QStringList& file_names);
56 
57 private:
58  void init_connections();
59 
60  int m_targetCanvasIndex{-1};
61  ImportFileWidget* m_fileSelectorWidget{nullptr};
62  ParserPropertyWidget* m_propertyWidget{nullptr};
63  QSplitter* m_splitter{nullptr};
64 };
65 
66 } // namespace gui2
67 
68 #endif // BORNAGAIN_GUI2_DATALOADER_LOADERSELECTORPANEL_H
Provides the possibility to select file names on disk and add them to list view.
Panel with settings for DataLoaderDialog.
void fileNamesChanged(const QStringList &file_names)
void fileSelectionChanged(const QStringList &file_names)
Panel to setup ASCII parser.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20