BornAgain  1.19.0
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/coregui/Views/JobWidgets/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_COREGUI_VIEWS_JOBWIDGETS_PARAMETERTUNINGWIDGET_H
16 #define BORNAGAIN_GUI_COREGUI_VIEWS_JOBWIDGETS_PARAMETERTUNINGWIDGET_H
17 
19 
20 class JobRealTimeToolBar;
21 class JobModel;
22 class JobItem;
23 class SessionItem;
24 class QItemSelectionModel;
28 class QTreeView;
29 class WarningSign;
30 class ParameterItem;
31 
32 //! Main widget for real time parameter tuning.
33 //! Contains a tree for parameter tuning and the model to provide drag-and-drop in FitActivityPanel.
34 
36  Q_OBJECT
37 
38 public:
39  explicit ParameterTuningWidget(QWidget* parent = 0);
40 
41  QItemSelectionModel* selectionModel();
42 
43  QVector<ParameterItem*> getSelectedParameters();
44 
45 signals:
46  void itemContextMenuRequest(const QPoint& point);
47 
48 public slots:
50  void onSliderValueChanged(double value);
51  void onLockZValueChanged(bool value);
53  void makeSelected(ParameterItem* item);
54 
55 protected:
56  void contextMenuEvent(QContextMenuEvent*);
57  void subscribeToItem();
58 
59 private slots:
60  void onPropertyChanged(const QString& property_name);
61  void updateParameterModel();
62  void onCustomContextMenuRequested(const QPoint& point);
63 
64 private:
65  JobItem* jobItem();
67  void setTuningDelegateEnabled(bool enabled);
68  void closeActiveEditors();
69 
74  QTreeView* m_treeView;
77 };
78 
79 #endif // BORNAGAIN_GUI_COREGUI_VIEWS_JOBWIDGETS_PARAMETERTUNINGWIDGET_H
Defines class ItemComboWidget.
Represents a toolbar with buttons for ParameterTuningWidget.
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.
void onCustomContextMenuRequested(const QPoint &point)
void makeSelected(ParameterItem *item)
ParameterTuningWidget(QWidget *parent=0)
void onCurrentLinkChanged(SessionItem *item)
ParameterTuningModel * m_parameterTuningModel
JobRealTimeToolBar * m_toolBar
void contextMenuEvent(QContextMenuEvent *)
void setTuningDelegateEnabled(bool enabled)
Sets delegate to enabled/disabled state.
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 onPropertyChanged(const QString &property_name)
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.
The WarningSign controls appearance of WarningSignWidget on top of parent widget.
Definition: WarningSign.h:25