BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ParameterTuningWidget.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Fit/ParameterTuningWidget.h
6 //! @brief Defines class ParameterTuningWidget
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_FIT_PARAMETERTUNINGWIDGET_H
16 #define BORNAGAIN_GUI_VIEW_FIT_PARAMETERTUNINGWIDGET_H
17 
19 
20 class JobModel;
21 class JobItem;
22 class SessionItem;
23 class QItemSelectionModel;
27 class QTreeView;
28 class CautionSign;
29 class ParameterItem;
30 
31 //! Main widget for real time parameter tuning.
32 //! Contains a tree for parameter tuning and the model to provide drag-and-drop in FitActivityPanel.
33 
35  Q_OBJECT
36 
37 public:
38  explicit ParameterTuningWidget(QWidget* parent = nullptr);
39 
40  QItemSelectionModel* selectionModel();
41 
42  QVector<ParameterItem*> getSelectedParameters();
43 
44 signals:
45  void itemContextMenuRequest(const QPoint& point);
46 
47 public slots:
49  void onSliderValueChanged(double value);
50  void onLockZValueChanged(bool value);
52  void makeSelected(ParameterItem* item);
53 
54 protected:
55  void contextMenuEvent(QContextMenuEvent*) override;
56  void subscribeToItem() override;
57 
58 private slots:
59  void updateParameterModel();
60  void onCustomContextMenuRequested(const QPoint& point);
61 
62 private:
63  JobItem* jobItem();
65  void setTuningDelegateEnabled(bool enabled);
66  void closeActiveEditors();
67  void updateJobStatus();
68 
72  QTreeView* m_treeView;
75 };
76 
77 #endif // BORNAGAIN_GUI_VIEW_FIT_PARAMETERTUNINGWIDGET_H
Defines class ItemComboWidget.
The CautionSign controls appearance of CautionSignWidget on top of parent widget.
Definition: CautionSign.h:25
The ParameterItem class represent a tuning value in a parameter tuning tree.
The ParameterTuningModel class represents parameters which can be tuned in real time in ParameterTuni...
Main widget for real time parameter tuning. Contains a tree for parameter tuning and the model to pro...
void onCustomContextMenuRequested(const QPoint &point)
void makeSelected(ParameterItem *item)
ParameterTuningModel * m_parameterTuningModel
ParameterTuningWidget(QWidget *parent=nullptr)
void contextMenuEvent(QContextMenuEvent *) override
void setTuningDelegateEnabled(bool enabled)
Sets delegate to enabled/disabled state. In 'disabled' state the delegate is in ReadOnlyMode,...
QVector< ParameterItem * > getSelectedParameters()
Returns list of ParameterItem's currently selected in parameter tree.
void itemContextMenuRequest(const QPoint &point)
void onLockZValueChanged(bool value)
QItemSelectionModel * selectionModel()
SliderSettingsWidget * m_sliderSettingsWidget
ParameterTuningDelegate * m_delegate
void onCurrentLinkChanged(ParameterItem *item)
void updateDragAndDropSettings()
Disable drag-and-drop abilities, if job is in fit running state.
void onSliderValueChanged(double value)
The SessionItemWidget class is a base for all widgets representing the content of SessionItem....
Base class for a GUI data item.
Definition: SessionItem.h:204