BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
importfilewidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/dataloader/importfilewidget.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_IMPORTFILEWIDGET_H
16 #define BORNAGAIN_GUI2_DATALOADER_IMPORTFILEWIDGET_H
17 
18 #include "darefl_export.h"
19 #include <QWidget>
20 
21 class QListView;
22 class QStringListModel;
23 
24 namespace gui2 {
25 
26 //! Provides the possibility to select file names on disk and add them to list view.
27 //! List represents names of ASCII files which will be later imported and parsed.
28 //! Part of LoaderPreviewPanel.
29 
30 class DAREFLCORE_EXPORT ImportFileWidget : public QWidget {
31  Q_OBJECT
32 
33 public:
34  ImportFileWidget(QWidget* parent = nullptr);
36 
37 public slots:
38  void onAddFilesRequest();
39  void onRemoveFileRequest();
40 
41  QStringList fileNames() const;
42 
43  QStringList selectedFileNames() const;
44 
45 signals:
48 
49 private:
50  void readSettings();
51  void writeSettings();
52 
53  QStringList validateForBinaryFiles(const QStringList& file_names);
54 
55  void updateCurrentWorkdir(const QStringList& file_names);
56  void addFileNamesToModel(const QStringList& file_names);
57 
58  void makeLastSelected();
59 
60  QListView* m_listView{nullptr};
61  QStringListModel* m_listModel{nullptr};
63 };
64 
65 } // namespace gui2
66 
67 #endif // BORNAGAIN_GUI2_DATALOADER_IMPORTFILEWIDGET_H
Provides the possibility to select file names on disk and add them to list view.
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20