BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
InstrumentListView.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Instrument/InstrumentListView.h
6 //! @brief Defines class InstrumentListView
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_INSTRUMENT_INSTRUMENTLISTVIEW_H
16 #define BORNAGAIN_GUI_VIEW_INSTRUMENT_INSTRUMENTLISTVIEW_H
17 
18 #include <QWidget>
19 
21 class QAction;
22 class QListView;
23 class InstrumentItem;
25 class ProjectDocument;
26 
27 //! Instrument selector on the left side of InstrumentView.
28 
29 class InstrumentListView : public QWidget {
30  Q_OBJECT
31 
32 public:
33  InstrumentListView(ProjectDocument* document, QWidget* parent = nullptr,
34  Qt::WindowFlags f = Qt::WindowFlags());
35 
36  QSize sizeHint() const override;
37  QSize minimumSizeHint() const override;
38 
39  QList<QAction*> toolbarActions() const;
40 
42 
43 signals:
45 
46 private slots:
48  void onNewGisas();
49  void onNewOffspec();
50  void onNewSpecular();
51  void onNewDepthProbe();
52 
53  void onRemove();
54  void onCopy();
55 
56  void onStoreInLibrary();
57  void onLoadFromLibrary();
58 
59 private:
60  //! Show/hide UI elements according to settings in current project
62 
63  void updateActions();
64  void ensureItemSelected();
65 
66 private:
68  QListView* m_listView;
70  QAction* m_newGisasAction;
75  QAction* m_removeAction;
76  QAction* m_copyAction;
80 };
81 
82 #endif // BORNAGAIN_GUI_VIEW_INSTRUMENT_INSTRUMENTLISTVIEW_H
Abstract base class for instrument-specific item classes.
List model for instruments.
Instrument selector on the left side of InstrumentView.
QSize minimumSizeHint() const override
ProjectDocument * m_document
InstrumentListModel * m_model
void onCopy()
Makes a copy of the currently selected instrument.
InstrumentItem * currentInstrument() const
void instrumentSelected(InstrumentItem *instrument)
QAction * m_newDepthProbeAction
QSize sizeHint() const override
QList< QAction * > toolbarActions() const
InstrumentListView(ProjectDocument *document, QWidget *parent=nullptr, Qt::WindowFlags f=Qt::WindowFlags())
void updateFunctionalityNarrowing()
Show/hide UI elements according to settings in current project.
void onRemove()
Removes currently selected instrument.
QAction * m_loadFromLibraryAction
QAction * m_storeInLibraryAction
Project document class handles all data related to the opened project (sample, job,...